diff --git a/MODULE.bazel b/MODULE.bazel index c04fe5d3ec33..d0d9ad4ea230 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -23,7 +23,7 @@ bazel_dep(name = "bazel_skylib", version = "1.6.1") bazel_dep(name = "abseil-cpp", version = "20240116.0", repo_name = "absl") bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json") bazel_dep(name = "fmt", version = "10.0.0") -bazel_dep(name = "rules_kotlin", version = "1.9.4-codeql.1") +bazel_dep(name = "rules_kotlin", version = "2.0.0-codeql.1") bazel_dep(name = "gazelle", version = "0.38.0") bazel_dep(name = "rules_dotnet", version = "0.15.1") bazel_dep(name = "googletest", version = "1.14.0.bcr.1") diff --git a/cpp/ql/lib/change-notes/2024-10-09-fopen-taint.md b/cpp/ql/lib/change-notes/2024-10-09-fopen-taint.md new file mode 100644 index 000000000000..d2516859a910 --- /dev/null +++ b/cpp/ql/lib/change-notes/2024-10-09-fopen-taint.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* Added taint flow model for `fopen` and related functions. \ No newline at end of file diff --git a/cpp/ql/lib/semmle/code/cpp/PrintAST.qll b/cpp/ql/lib/semmle/code/cpp/PrintAST.qll index 6194710f0c58..3bdbd637cca6 100644 --- a/cpp/ql/lib/semmle/code/cpp/PrintAST.qll +++ b/cpp/ql/lib/semmle/code/cpp/PrintAST.qll @@ -80,6 +80,8 @@ private Declaration getAnEnclosingDeclaration(Locatable ast) { or result = ast.(Parameter).getFunction() or + result = ast.(Parameter).getCatchBlock().getEnclosingFunction() + or result = ast.(Expr).getEnclosingDeclaration() or result = ast.(Initializer).getDeclaration() @@ -510,6 +512,22 @@ class DeclStmtNode extends StmtNode { } } +/** + * A node representing a `Handler`. + */ +class HandlerNode extends ChildStmtNode { + Handler handler; + + HandlerNode() { handler = stmt } + + override BaseAstNode getChildInternal(int childIndex) { + result = super.getChildInternal(childIndex) + or + childIndex = -1 and + result.getAst() = handler.getParameter() + } +} + /** * A node representing a `Parameter`. */ @@ -754,6 +772,8 @@ private predicate namedStmtChildPredicates(Locatable s, Element e, string pred) or s.(ConstexprIfStmt).getElse() = e and pred = "getElse()" or + s.(Handler).getParameter() = e and pred = "getParameter()" + or s.(IfStmt).getInitialization() = e and pred = "getInitialization()" or s.(IfStmt).getCondition() = e and pred = "getCondition()" diff --git a/cpp/ql/lib/semmle/code/cpp/models/implementations/Fopen.qll b/cpp/ql/lib/semmle/code/cpp/models/implementations/Fopen.qll index 6bc700becf1e..fc6ceb321c1f 100644 --- a/cpp/ql/lib/semmle/code/cpp/models/implementations/Fopen.qll +++ b/cpp/ql/lib/semmle/code/cpp/models/implementations/Fopen.qll @@ -7,7 +7,7 @@ import semmle.code.cpp.models.interfaces.Alias import semmle.code.cpp.models.interfaces.SideEffect /** The function `fopen` and friends. */ -private class Fopen extends Function, AliasFunction, SideEffectFunction { +private class Fopen extends Function, AliasFunction, SideEffectFunction, TaintFunction { Fopen() { this.hasGlobalOrStdName(["fopen", "fopen_s", "freopen"]) or @@ -47,4 +47,22 @@ private class Fopen extends Function, AliasFunction, SideEffectFunction { i = 0 and buffer = true } + + override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) { + ( + this.hasGlobalOrStdName(["fopen", "freopen"]) or + this.hasGlobalName(["_wfopen", "_fsopen", "_wfsopen"]) + ) and + input.isParameterDeref(0) and + output.isReturnValueDeref() + or + // The out parameter is a pointer to a `FILE*`. + this.hasGlobalOrStdName("fopen_s") and + input.isParameterDeref(1) and + output.isParameterDeref(0, 2) + or + this.hasGlobalName(["_open", "_wopen"]) and + input.isParameterDeref(0) and + output.isReturnValue() + } } diff --git a/cpp/ql/test/examples/expressions/PrintAST.expected b/cpp/ql/test/examples/expressions/PrintAST.expected index 7de95cb8b4a4..e8e753becb56 100644 --- a/cpp/ql/test/examples/expressions/PrintAST.expected +++ b/cpp/ql/test/examples/expressions/PrintAST.expected @@ -870,6 +870,8 @@ Throw.cpp: # 8| Type = [BoolType] bool # 8| ValueCategory = prvalue # 12| getChild(1): [Handler] +# 12| getParameter(): [Parameter] e +# 12| Type = [PointerType] E * # 12| getBlock(): [CatchBlock] { ... } # 13| getStmt(0): [ExprStmt] ExprStmt # 13| getExpr(): [ReThrowExpr] re-throw exception diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected b/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected index 80541c16115f..7de6914e8aac 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/localTaint.expected @@ -6584,6 +6584,16 @@ WARNING: module 'TaintTracking' has been deprecated and may be removed in future | taint.cpp:767:21:767:24 | ref arg path | taint.cpp:768:8:768:11 | path | | | taint.cpp:768:8:768:11 | path | taint.cpp:768:7:768:11 | * ... | | | taint.cpp:778:37:778:42 | call to source | taint.cpp:779:7:779:9 | obj | | +| taint.cpp:785:23:785:28 | source | taint.cpp:785:23:785:28 | source | | +| taint.cpp:785:23:785:28 | source | taint.cpp:786:18:786:23 | source | | +| taint.cpp:785:23:785:28 | source | taint.cpp:790:15:790:20 | source | | +| taint.cpp:786:12:786:16 | call to fopen | taint.cpp:787:7:787:7 | f | | +| taint.cpp:786:18:786:23 | source | taint.cpp:786:12:786:16 | call to fopen | TAINT | +| taint.cpp:789:8:789:9 | f2 | taint.cpp:790:11:790:12 | f2 | | +| taint.cpp:789:8:789:9 | f2 | taint.cpp:791:7:791:8 | f2 | | +| taint.cpp:790:10:790:12 | ref arg & ... | taint.cpp:790:11:790:12 | f2 [inner post update] | | +| taint.cpp:790:10:790:12 | ref arg & ... | taint.cpp:791:7:791:8 | f2 | | +| taint.cpp:790:11:790:12 | f2 | taint.cpp:790:10:790:12 | & ... | | | vector.cpp:16:43:16:49 | source1 | vector.cpp:17:26:17:32 | source1 | | | vector.cpp:16:43:16:49 | source1 | vector.cpp:31:38:31:44 | source1 | | | vector.cpp:17:21:17:33 | call to vector | vector.cpp:19:14:19:14 | v | | diff --git a/cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp b/cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp index 220265a3bb1a..a5f63b3d2e61 100644 --- a/cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp +++ b/cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp @@ -777,4 +777,16 @@ TaintInheritingContentObject source(bool); void test_TaintInheritingContent() { TaintInheritingContentObject obj = source(true); sink(obj.flowFromObject); // $ ir MISSING: ast +} + +FILE* fopen(const char*, const char*); +int fopen_s(FILE** pFile, const char *filename, const char *mode); + +void fopen_test(char* source) { + FILE* f = fopen(source, "r"); + sink(f); // $ ast,ir + + FILE* f2; + fopen_s(&f2, source, "r"); + sink(f2); // $ ast,ir } \ No newline at end of file diff --git a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected index 1e0ef80c269b..510d13fdfa2b 100644 --- a/cpp/ql/test/library-tests/ir/ir/PrintAST.expected +++ b/cpp/ql/test/library-tests/ir/ir/PrintAST.expected @@ -9055,6 +9055,8 @@ ir.cpp: # 733| Value = [Literal] 7 # 733| ValueCategory = prvalue # 735| getChild(1): [Handler] +# 735| getParameter(): [Parameter] s +# 735| Type = [PointerType] const char * # 735| getBlock(): [CatchBlock] { ... } # 736| getStmt(0): [ExprStmt] ExprStmt # 736| getExpr(): [ThrowExpr] throw ... @@ -9067,6 +9069,8 @@ ir.cpp: # 736| Type = [PointerType] const char * # 736| ValueCategory = prvalue(load) # 738| getChild(2): [Handler] +# 738| getParameter(): [Parameter] e +# 738| Type = [LValueReferenceType] const String & # 738| getBlock(): [CatchBlock] { ... } # 740| getChild(3): [Handler] # 740| getBlock(): [CatchAnyBlock] { ... } @@ -12852,6 +12856,8 @@ ir.cpp: # 1200| Value = [Literal] 7 # 1200| ValueCategory = prvalue # 1202| getChild(1): [Handler] +# 1202| getParameter(): [Parameter] s +# 1202| Type = [PointerType] const char * # 1202| getBlock(): [CatchBlock] { ... } # 1203| getStmt(0): [ExprStmt] ExprStmt # 1203| getExpr(): [ThrowExpr] throw ... @@ -12864,6 +12870,8 @@ ir.cpp: # 1203| Type = [PointerType] const char * # 1203| ValueCategory = prvalue(load) # 1205| getChild(2): [Handler] +# 1205| getParameter(): [Parameter] e +# 1205| Type = [LValueReferenceType] const String & # 1205| getBlock(): [CatchBlock] { ... } # 1207| getStmt(1): [ReturnStmt] return ... # 1211| [TopLevelFunction] void VectorTypes(int) @@ -20586,6 +20594,8 @@ ir.cpp: # 2281| Type = [Struct] String # 2281| ValueCategory = lvalue # 2282| getChild(1): [Handler] +# 2282| getParameter(): [Parameter] s +# 2282| Type = [PointerType] const char * # 2282| getBlock(): [CatchBlock] { ... } # 2283| getStmt(0): [ExprStmt] ExprStmt # 2283| getExpr(): [ThrowExpr] throw ... @@ -20598,6 +20608,8 @@ ir.cpp: # 2283| Type = [PointerType] const char * # 2283| ValueCategory = prvalue(load) # 2285| getChild(2): [Handler] +# 2285| getParameter(): [Parameter] e +# 2285| Type = [LValueReferenceType] const String & # 2285| getBlock(): [CatchBlock] { ... } # 2287| getChild(3): [Handler] # 2287| getBlock(): [CatchAnyBlock] { ... } @@ -22845,6 +22857,8 @@ ir.cpp: # 2537| Value = [Literal] 42 # 2537| ValueCategory = prvalue # 2539| getChild(1): [Handler] +# 2539| getParameter(): [Parameter] (unnamed parameter 0) +# 2539| Type = [PlainCharType] char # 2539| getBlock(): [CatchBlock] { ... } # 2541| getImplicitDestructorCall(0): [DestructorCall] call to ~ClassWithDestructor # 2541| Type = [VoidType] void diff --git a/docs/codeql/index.html b/docs/codeql/index.html index de47832a997c..2f9dcd451ef7 100644 --- a/docs/codeql/index.html +++ b/docs/codeql/index.html @@ -101,7 +101,7 @@

latest version of CodeQL...
- +
CodeQL coverage of CWEs
Detailed information on the coverage of Common Weakness Enumerations (CWEs) in the latest release...
diff --git a/misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/source.json b/misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/source.json deleted file mode 100644 index 5089476d754a..000000000000 --- a/misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/source.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "integrity": "sha256-dsD8wsI+33NjIK3tGs2d3guuQY5XMd8Skz2IbLqGt5U=", - "url": "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.9.4/rules_kotlin-v1.9.4.tar.gz", - "patches": { - "codeql_do_not_emit_jdeps.patch": "sha256-x/HsujFlR1FGrgmbAbRZag9V4vKZZinBcs73tgRS478=", - "codeql_add_language_version_option.patch": "sha256-qFpP/hIvqGzjJi0h8LAQK0UuWqwlj/oCecZYGqlMVP8=" - }, - "patch_strip": 1 -} diff --git a/misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/MODULE.bazel b/misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/MODULE.bazel similarity index 74% rename from misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/MODULE.bazel rename to misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/MODULE.bazel index 4982ad4b9a4d..6c11301e2340 100644 --- a/misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/MODULE.bazel +++ b/misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/MODULE.bazel @@ -1,14 +1,16 @@ module( name = "rules_kotlin", - version = "1.9.4-codeql.1", + version = "2.0.0-codeql.1", + compatibility_level = 1, repo_name = "rules_kotlin", ) -bazel_dep(name = "platforms", version = "0.0.6") -bazel_dep(name = "bazel_skylib", version = "1.4.2") +bazel_dep(name = "platforms", version = "0.0.10") +bazel_dep(name = "bazel_skylib", version = "1.7.1") bazel_dep(name = "rules_java", version = "7.2.0") bazel_dep(name = "rules_python", version = "0.23.1") bazel_dep(name = "rules_cc", version = "0.0.8") +bazel_dep(name = "rules_android", version = "0.1.1") rules_kotlin_extensions = use_extension( "//src/main/starlark/core/repositories:bzlmod_setup.bzl", @@ -19,7 +21,9 @@ use_repo( "com_github_google_ksp", "com_github_jetbrains_kotlin", "com_github_pinterest_ktlint", - "rules_android", + "kotlinx_serialization_core_jvm", + "kotlinx_serialization_json", + "kotlinx_serialization_json_jvm", ) register_toolchains("//kotlin/internal:default_toolchain") diff --git a/misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/patches/codeql_add_language_version_option.patch b/misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/patches/codeql_add_language_version_option.patch similarity index 80% rename from misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/patches/codeql_add_language_version_option.patch rename to misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/patches/codeql_add_language_version_option.patch index bb8fa5e4fcaf..d5716daba07b 100644 --- a/misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/patches/codeql_add_language_version_option.patch +++ b/misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/patches/codeql_add_language_version_option.patch @@ -1,13 +1,13 @@ We need to build different extractor variants with different -language-version options, which is not allowed in current kotlin_rules diff --git a/src/main/starlark/core/options/opts.kotlinc.bzl b/src/main/starlark/core/options/opts.kotlinc.bzl -index 9b15fb8..c0ac2cd 100644 +index 5e1461b..b93e6aa 100644 --- a/src/main/starlark/core/options/opts.kotlinc.bzl +++ b/src/main/starlark/core/options/opts.kotlinc.bzl -@@ -28,6 +28,11 @@ def _map_jvm_target_to_flag(version): +@@ -33,6 +33,11 @@ def _map_jdk_release_to_flag(version): return None - return ["-jvm-target=%s" % version] - + return ["-Xjdk-release=%s" % version] + +def _map_language_version_to_flag(version): + if not version: + return None @@ -16,9 +16,9 @@ index 9b15fb8..c0ac2cd 100644 _KOPTS_ALL = { "warn": struct( args = dict( -@@ -349,6 +354,15 @@ _KOPTS_ALL = { +@@ -417,6 +422,15 @@ _KOPTS_ALL = { value_to_flag = None, - map_value_to_flag = _map_jvm_target_to_flag, + map_value_to_flag = _map_jdk_release_to_flag, ), + "language_version": struct( + args = dict( @@ -30,5 +30,5 @@ index 9b15fb8..c0ac2cd 100644 + map_value_to_flag = _map_language_version_to_flag, + ), } - - # Filters out options that are not available in current compiler release + + # Filters out options that are not available in current compiler release \ No newline at end of file diff --git a/misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/patches/codeql_do_not_emit_jdeps.patch b/misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/patches/codeql_do_not_emit_jdeps.patch similarity index 73% rename from misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/patches/codeql_do_not_emit_jdeps.patch rename to misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/patches/codeql_do_not_emit_jdeps.patch index 1a01bd2c91bc..380c837d06a4 100644 --- a/misc/bazel/registry/modules/rules_kotlin/1.9.4-codeql.1/patches/codeql_do_not_emit_jdeps.patch +++ b/misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/patches/codeql_do_not_emit_jdeps.patch @@ -1,9 +1,11 @@ Emitting jdeps is broken for the 2.0.0 kotlin extractor, and we don't need those files. Patching it here rather than passing `--@rules_kotlin//kotlin/settings:jvm_emit_jdeps=false` allows us to not have to specify that option (and therefore pull in `rules_kotlin`) in `semmle-code`. ---- a/kotlin/settings/BUILD.bazel 2000-01-01 01:00:00.000000000 +0100 -+++ b/kotlin/settings/BUILD.bazel 2024-04-10 14:51:16.060085986 +0200 -@@ -16,7 +16,7 @@ +diff --git a/kotlin/settings/BUILD.bazel b/kotlin/settings/BUILD.bazel +index 2c93c11..f352b80 100644 +--- a/kotlin/settings/BUILD.bazel ++++ b/kotlin/settings/BUILD.bazel +@@ -25,7 +25,7 @@ release_archive( # Flag that controls the emission of jdeps files during kotlin jvm compilation. bool_flag( name = "jvm_emit_jdeps", diff --git a/misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/source.json b/misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/source.json new file mode 100644 index 000000000000..96d828e3455a --- /dev/null +++ b/misc/bazel/registry/modules/rules_kotlin/2.0.0-codeql.1/source.json @@ -0,0 +1,9 @@ +{ + "integrity": "sha256-2JcjzJ67t72y66yhr30jg+B0YVZDz5ejZrdYp2t9xEM=", + "url": "https://github.com/bazelbuild/rules_kotlin/releases/download/v2.0.0/rules_kotlin-v2.0.0.tar.gz", + "patches": { + "codeql_do_not_emit_jdeps.patch": "sha256-1ir4Aio1SICxnj1wafQ0GefT/m7bwn2n+SQwq19V3A8=", + "codeql_add_language_version_option.patch": "sha256-t8Fm0bYZ4Q4vTqcoXZjyK4WPEoAafjE4whJLNnrnRbg=" + }, + "patch_strip": 1 +} diff --git a/misc/bazel/registry/modules/rules_kotlin/metadata.json b/misc/bazel/registry/modules/rules_kotlin/metadata.json index e399c3f5b0a2..ac259b2e729a 100644 --- a/misc/bazel/registry/modules/rules_kotlin/metadata.json +++ b/misc/bazel/registry/modules/rules_kotlin/metadata.json @@ -21,7 +21,7 @@ "github:bazelbuild/rules_kotlin" ], "versions": [ - "1.9.4-codeql.1" + "2.0.0-codeql.1" ], "yanked_versions": {} } diff --git a/misc/codegen/lib/schemadefs.py b/misc/codegen/lib/schemadefs.py index 7152c32d12b1..ea8d6cf09ce7 100644 --- a/misc/codegen/lib/schemadefs.py +++ b/misc/codegen/lib/schemadefs.py @@ -1,4 +1,8 @@ -from typing import Callable as _Callable, Dict as _Dict, ClassVar as _ClassVar +from typing import ( + Callable as _Callable, + Dict as _Dict, + ClassVar as _ClassVar, +) from misc.codegen.lib import schema as _schema import inspect as _inspect from dataclasses import dataclass as _dataclass @@ -271,14 +275,16 @@ def __or__(self, other: _schema.PropertyModifier): _ = _PropertyAnnotation() +drop = object() -def annotate(annotated_cls: type) -> _Callable[[type], _PropertyAnnotation]: + +def annotate(annotated_cls: type, replace_bases: _Dict[type, type] | None = None) -> _Callable[[type], _PropertyAnnotation]: """ - Add or modify schema annotations after a class has been defined - For the moment, only docstring annotation is supported. In the future, any kind of - modification will be allowed. + Add or modify schema annotations after a class has been defined previously. + + The name of the class used for annotation must be `_`. - The name of the class used for annotation must be `_` + `replace_bases` can be used to replace bases on the annotated class. """ def decorator(cls: type) -> _PropertyAnnotation: if cls.__name__ != "_": @@ -287,11 +293,15 @@ def decorator(cls: type) -> _PropertyAnnotation: annotated_cls.__doc__ = cls.__doc__ for p, v in cls.__dict__.get("_pragmas", {}).items(): _ClassPragma(p, value=v)(annotated_cls) + if replace_bases: + annotated_cls.__bases__ = tuple(replace_bases.get(b, b) for b in annotated_cls.__bases__) for a in dir(cls): if a.startswith(_schema.inheritable_pragma_prefix): setattr(annotated_cls, a, getattr(cls, a)) for p, a in cls.__annotations__.items(): - if p in annotated_cls.__annotations__: + if a is drop: + del annotated_cls.__annotations__[p] + elif p in annotated_cls.__annotations__: annotated_cls.__annotations__[p] |= a elif isinstance(a, (_PropertyAnnotation, _PropertyModifierList)): raise _schema.Error(f"annotated property {p} not present in annotated class " diff --git a/misc/codegen/test/test_schemaloader.py b/misc/codegen/test/test_schemaloader.py index 4d1aa06ecd0f..0c9128c72727 100644 --- a/misc/codegen/test/test_schemaloader.py +++ b/misc/codegen/test/test_schemaloader.py @@ -884,6 +884,56 @@ class Something: """ +def test_annotate_replace_bases(): + @load + class data: + class Root: + pass + + class A(Root): + pass + + class B(Root): + pass + + class C(B): + pass + + class Derived(A, B): + pass + + @defs.annotate(Derived, replace_bases={B: C}) + class _: + pass + assert data.classes == { + "Root": schema.Class("Root", derived={"A", "B"}), + "A": schema.Class("A", bases=["Root"], derived={"Derived"}), + "B": schema.Class("B", bases=["Root"], derived={"C"}), + "C": schema.Class("C", bases=["B"], derived={"Derived"}), + "Derived": schema.Class("Derived", bases=["A", "C"]), + } + + +def test_annotate_drop_field(): + @load + class data: + class Root: + x: defs.int + y: defs.string + z: defs.boolean + + @defs.annotate(Root) + class _: + y: defs.drop + + assert data.classes == { + "Root": schema.Class("Root", properties=[ + schema.SingleProperty("x", "int"), + schema.SingleProperty("z", "boolean"), + ]), + } + + def test_test_with_unknown_string(): with pytest.raises(schema.Error): @load diff --git a/ruby/ql/consistency-queries/AstConsistency.ql b/ruby/ql/consistency-queries/AstConsistency.ql index 2a9fea8fea90..d7792a8ae4d0 100644 --- a/ruby/ql/consistency-queries/AstConsistency.ql +++ b/ruby/ql/consistency-queries/AstConsistency.ql @@ -31,3 +31,5 @@ query predicate multipleToString(AstNode n, string s) { } query predicate extractionError(ExtractionError error) { any() } + +query predicate extractionWarning(ExtractionWarning error) { any() } diff --git a/ruby/ql/lib/change-notes/2024-10-03-extraction-warnings.md b/ruby/ql/lib/change-notes/2024-10-03-extraction-warnings.md new file mode 100644 index 000000000000..5d6128354c3b --- /dev/null +++ b/ruby/ql/lib/change-notes/2024-10-03-extraction-warnings.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The `ExtractionError` class has been split into `ExtractionError` and `ExtractionWarning`, reporting extraction errors and warnings respectively. diff --git a/ruby/ql/lib/codeql/ruby/AST.qll b/ruby/ql/lib/codeql/ruby/AST.qll index e8dc28692c07..bd42696a8dbe 100644 --- a/ruby/ql/lib/codeql/ruby/AST.qll +++ b/ruby/ql/lib/codeql/ruby/AST.qll @@ -18,6 +18,7 @@ private import ast.internal.Scope private import ast.internal.Synthesis private import ast.internal.TreeSitter private import Customizations +private import Diagnostics cached private module Cached { @@ -166,3 +167,20 @@ class RubyFile extends File { /** Gets the number of lines of comments in this file. */ int getNumberOfLinesOfComments() { result = count(int line | this.line(line, true)) } } + +/** + * A successfully extracted file, that is, a file that was extracted and + * contains no extraction errors or warnings. + */ +class SuccessfullyExtractedFile extends File { + SuccessfullyExtractedFile() { + not exists(Diagnostic d | + d.getLocation().getFile() = this and + ( + d instanceof ExtractionError + or + d instanceof ExtractionWarning + ) + ) + } +} diff --git a/ruby/ql/lib/codeql/ruby/Diagnostics.qll b/ruby/ql/lib/codeql/ruby/Diagnostics.qll index 5902bb594141..58de14b8fcf5 100644 --- a/ruby/ql/lib/codeql/ruby/Diagnostics.qll +++ b/ruby/ql/lib/codeql/ruby/Diagnostics.qll @@ -48,7 +48,8 @@ class Diagnostic extends @diagnostic { string toString() { result = this.getMessage() } } -/** A diagnostic relating to a particular error in extracting a file. */ -class ExtractionError extends Diagnostic { - ExtractionError() { this.getTag() = "parse_error" } -} +/** A diagnostic that is error severity. */ +class ExtractionError extends Diagnostic, @diagnostic_error { } + +/** A diagnostic that is warning severity. */ +class ExtractionWarning extends Diagnostic, @diagnostic_warning { } diff --git a/ruby/ql/src/change-notes/2024-10-03-extraction-warnings.md b/ruby/ql/src/change-notes/2024-10-03-extraction-warnings.md new file mode 100644 index 000000000000..ac97cd1e7ba2 --- /dev/null +++ b/ruby/ql/src/change-notes/2024-10-03-extraction-warnings.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The `rb/diagnostics/extraction-errors` diagnostic query has been split into `rb/diagnostics/extraction-errors` and `rb/diagnostics/extraction-warnings`, counting extraction errors and warnings respectively. diff --git a/ruby/ql/src/queries/diagnostics/ExtractionWarnings.ql b/ruby/ql/src/queries/diagnostics/ExtractionWarnings.ql new file mode 100644 index 000000000000..74f007390567 --- /dev/null +++ b/ruby/ql/src/queries/diagnostics/ExtractionWarnings.ql @@ -0,0 +1,19 @@ +/** + * @name Extraction warnings + * @description List all extraction warnings for files in the source code directory. + * @kind diagnostic + * @id rb/diagnostics/extraction-warnings + */ + +import codeql.ruby.AST +import codeql.ruby.Diagnostics + +/** Gets the SARIF severity to associate with a warning. */ +int getSeverity() { result = 1 } + +from ExtractionWarning warning, File f +where + f = warning.getLocation().getFile() and + exists(f.getRelativePath()) +select warning, "Extraction warning in " + f + " with message " + warning.getMessage(), + getSeverity() diff --git a/ruby/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql b/ruby/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql index 8623ed911d5a..1cbc28b6cc6b 100644 --- a/ruby/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql +++ b/ruby/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql @@ -2,14 +2,15 @@ * @id rb/summary/number-of-files-extracted-with-errors * @name Total number of Ruby files that were extracted with errors * @description The total number of Ruby code files that we extracted, but where - * at least one extraction error occurred in the process. + * at least one extraction error (or warning) occurred in the process. * @kind metric * @tags summary */ import codeql.ruby.AST -import codeql.ruby.Diagnostics +import codeql.files.FileSystem select count(File f | - exists(ExtractionError e | e.getLocation().getFile() = f) and exists(f.getRelativePath()) + exists(f.getRelativePath()) and + not f instanceof SuccessfullyExtractedFile ) diff --git a/ruby/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql b/ruby/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql index 236374ff2261..afd667cf58c5 100644 --- a/ruby/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql +++ b/ruby/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql @@ -2,14 +2,12 @@ * @id rb/summary/number-of-successfully-extracted-files * @name Total number of Ruby files that were extracted without error * @description The total number of Ruby code files that we extracted without - * encountering any extraction errors + * encountering any extraction errors (or warnings). * @kind metric * @tags summary */ import codeql.ruby.AST -import codeql.ruby.Diagnostics +import codeql.files.FileSystem -select count(File f | - not exists(ExtractionError e | e.getLocation().getFile() = f) and exists(f.getRelativePath()) - ) +select count(SuccessfullyExtractedFile f | exists(f.getRelativePath())) diff --git a/ruby/ql/test/query-tests/diagnostics/CONSISTENCY/AstConsistency.expected b/ruby/ql/test/query-tests/diagnostics/CONSISTENCY/AstConsistency.expected index 5dc14116b917..93df75151a77 100644 --- a/ruby/ql/test/query-tests/diagnostics/CONSISTENCY/AstConsistency.expected +++ b/ruby/ql/test/query-tests/diagnostics/CONSISTENCY/AstConsistency.expected @@ -1,2 +1,2 @@ -extractionError +extractionWarning | src/not_ruby.rb:5:25:5:26 | A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis. | diff --git a/ruby/ql/test/query-tests/diagnostics/ExtractionErrors.expected b/ruby/ql/test/query-tests/diagnostics/ExtractionErrors.expected index dc37ca3642b3..e69de29bb2d1 100644 --- a/ruby/ql/test/query-tests/diagnostics/ExtractionErrors.expected +++ b/ruby/ql/test/query-tests/diagnostics/ExtractionErrors.expected @@ -1 +0,0 @@ -| src/not_ruby.rb:5:25:5:26 | A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis. | Extraction failed in src/not_ruby.rb with error A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis. | 2 | diff --git a/ruby/ql/test/query-tests/diagnostics/ExtractionWarnings.expected b/ruby/ql/test/query-tests/diagnostics/ExtractionWarnings.expected new file mode 100644 index 000000000000..c47ec9c5d365 --- /dev/null +++ b/ruby/ql/test/query-tests/diagnostics/ExtractionWarnings.expected @@ -0,0 +1 @@ +| src/not_ruby.rb:5:25:5:26 | A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis. | Extraction warning in src/not_ruby.rb with message A parse error occurred. Check the syntax of the file. If the file is invalid, correct the error or exclude the file from analysis. | 1 | diff --git a/ruby/ql/test/query-tests/diagnostics/ExtractionWarnings.qlref b/ruby/ql/test/query-tests/diagnostics/ExtractionWarnings.qlref new file mode 100644 index 000000000000..ff6e566d20a7 --- /dev/null +++ b/ruby/ql/test/query-tests/diagnostics/ExtractionWarnings.qlref @@ -0,0 +1 @@ +queries/diagnostics/ExtractionWarnings.ql diff --git a/rust/ast-generator/src/main.rs b/rust/ast-generator/src/main.rs index 3b5a7aa8e7d4..5f29fa424f77 100644 --- a/rust/ast-generator/src/main.rs +++ b/rust/ast-generator/src/main.rs @@ -3,7 +3,7 @@ use std::{fs, path::PathBuf}; pub mod codegen; mod flags; -use codegen::grammar::ast_src::{AstNodeSrc, AstSrc}; +use codegen::grammar::ast_src::{AstNodeSrc, AstSrc, Field}; use std::collections::{BTreeMap, BTreeSet}; use std::env; use ungrammar::Grammar; @@ -94,7 +94,13 @@ fn write_schema( } empty = false; - if field.tp == "string" { + if field.tp == "predicate" { + writeln!( + buf, + " {}: predicate", + property_name(&node.name, &field.name), + )?; + } else if field.tp == "string" { writeln!( buf, " {}: optional[string]", @@ -131,6 +137,21 @@ struct FieldInfo { } fn get_fields(node: &AstNodeSrc) -> Vec { let mut result = Vec::new(); + let predicates = [ + "async", "auto", "const", "default", "gen", "move", "mut", "raw", "ref", "static", "try", + "unsafe", + ]; + for field in &node.fields { + if let Field::Token(name) = field { + if predicates.contains(&name.as_str()) { + result.push(FieldInfo { + name: format!("is_{name}"), + tp: "predicate".to_string(), + is_many: false, + }); + } + } + } match node.name.as_str() { "Name" | "NameRef" | "Lifetime" => { @@ -481,7 +502,14 @@ impl Translator<'_> {{ let type_name = &field.tp; let struct_field_name = &field.name; let class_field_name = property_name(&node.name, &field.name); - if field.tp == "string" { + if field.tp == "predicate" { + writeln!( + buf, + " let {} = node.{}_token().is_some();", + class_field_name, + &struct_field_name[3..], + )?; + } else if field.tp == "string" { writeln!( buf, " let {} = node.try_get_text();", diff --git a/rust/extractor/src/generated/.generated.list b/rust/extractor/src/generated/.generated.list index e215cdc425c7..f9c6aa0afefd 100644 --- a/rust/extractor/src/generated/.generated.list +++ b/rust/extractor/src/generated/.generated.list @@ -1,2 +1,2 @@ mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 -top.rs bbb8453f35cce3f2afa86b32c01296f78a24c19f504f9416aa049d256d11d23a bbb8453f35cce3f2afa86b32c01296f78a24c19f504f9416aa049d256d11d23a +top.rs 29bca54c5bf58ebc5bcc1d17de53c3fa23080c403c52e25be4a3c9dcafd26622 29bca54c5bf58ebc5bcc1d17de53c3fa23080c403c52e25be4a3c9dcafd26622 diff --git a/rust/extractor/src/generated/top.rs b/rust/extractor/src/generated/top.rs index bb21051d7bb9..6e280593a0b8 100644 --- a/rust/extractor/src/generated/top.rs +++ b/rust/extractor/src/generated/top.rs @@ -1306,6 +1306,7 @@ impl From> for trap::Label { pub struct Meta { pub id: trap::TrapId, pub expr: Option>, + pub is_unsafe: bool, pub path: Option>, pub token_tree: Option>, } @@ -1320,6 +1321,9 @@ impl trap::TrapEntry for Meta { if let Some(v) = self.expr { out.add_tuple("meta_exprs", vec![id.into(), v.into()]); } + if self.is_unsafe { + out.add_tuple("meta_is_unsafe", vec![id.into()]); + } if let Some(v) = self.path { out.add_tuple("meta_paths", vec![id.into(), v.into()]); } @@ -2176,6 +2180,7 @@ impl From> for trap::Label { pub struct SelfParam { pub id: trap::TrapId, pub attrs: Vec>, + pub is_mut: bool, pub lifetime: Option>, pub name: Option>, pub ty: Option>, @@ -2191,6 +2196,9 @@ impl trap::TrapEntry for SelfParam { for (i, v) in self.attrs.into_iter().enumerate() { out.add_tuple("self_param_attrs", vec![id.into(), i.into(), v.into()]); } + if self.is_mut { + out.add_tuple("self_param_is_mut", vec![id.into()]); + } if let Some(v) = self.lifetime { out.add_tuple("self_param_lifetimes", vec![id.into(), v.into()]); } @@ -2526,6 +2534,8 @@ impl From> for trap::Label { pub struct TypeBound { pub id: trap::TrapId, pub generic_param_list: Option>, + pub is_async: bool, + pub is_const: bool, pub lifetime: Option>, pub ty: Option>, } @@ -2540,6 +2550,12 @@ impl trap::TrapEntry for TypeBound { if let Some(v) = self.generic_param_list { out.add_tuple("type_bound_generic_param_lists", vec![id.into(), v.into()]); } + if self.is_async { + out.add_tuple("type_bound_is_async", vec![id.into()]); + } + if self.is_const { + out.add_tuple("type_bound_is_const", vec![id.into()]); + } if let Some(v) = self.lifetime { out.add_tuple("type_bound_lifetimes", vec![id.into(), v.into()]); } @@ -3529,6 +3545,12 @@ impl From> for trap::Label { pub struct BlockExpr { pub id: trap::TrapId, pub attrs: Vec>, + pub is_async: bool, + pub is_const: bool, + pub is_gen: bool, + pub is_move: bool, + pub is_try: bool, + pub is_unsafe: bool, pub label: Option>, pub stmt_list: Option>, } @@ -3543,6 +3565,24 @@ impl trap::TrapEntry for BlockExpr { for (i, v) in self.attrs.into_iter().enumerate() { out.add_tuple("block_expr_attrs", vec![id.into(), i.into(), v.into()]); } + if self.is_async { + out.add_tuple("block_expr_is_async", vec![id.into()]); + } + if self.is_const { + out.add_tuple("block_expr_is_const", vec![id.into()]); + } + if self.is_gen { + out.add_tuple("block_expr_is_gen", vec![id.into()]); + } + if self.is_move { + out.add_tuple("block_expr_is_move", vec![id.into()]); + } + if self.is_try { + out.add_tuple("block_expr_is_try", vec![id.into()]); + } + if self.is_unsafe { + out.add_tuple("block_expr_is_unsafe", vec![id.into()]); + } if let Some(v) = self.label { out.add_tuple("block_expr_labels", vec![id.into(), v.into()]); } @@ -3719,66 +3759,44 @@ impl From> for trap::Label { } #[derive(Debug)] -pub struct CallExpr { - pub id: trap::TrapId, - pub arg_list: Option>, - pub attrs: Vec>, - pub expr: Option>, -} - -impl trap::TrapEntry for CallExpr { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("call_exprs", vec![id.into()]); - if let Some(v) = self.arg_list { - out.add_tuple("call_expr_arg_lists", vec![id.into(), v.into()]); - } - for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("call_expr_attrs", vec![id.into(), i.into(), v.into()]); - } - if let Some(v) = self.expr { - out.add_tuple("call_expr_exprs", vec![id.into(), v.into()]); - } - } +pub struct CallExprBase { + _unused: () } -impl trap::TrapClass for CallExpr { - fn class_name() -> &'static str { "CallExpr" } +impl trap::TrapClass for CallExprBase { + fn class_name() -> &'static str { "CallExprBase" } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of AstNode +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExprBase is a subclass of AstNode unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of Element +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExprBase is a subclass of Element unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of Expr +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExprBase is a subclass of Expr unsafe { Self::from_untyped(value.as_untyped()) } } } -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of Locatable +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExprBase is a subclass of Locatable unsafe { Self::from_untyped(value.as_untyped()) } @@ -3858,6 +3876,11 @@ pub struct ClosureExpr { pub attrs: Vec>, pub body: Option>, pub closure_binder: Option>, + pub is_async: bool, + pub is_const: bool, + pub is_gen: bool, + pub is_move: bool, + pub is_static: bool, pub param_list: Option>, pub ret_type: Option>, } @@ -3878,6 +3901,21 @@ impl trap::TrapEntry for ClosureExpr { if let Some(v) = self.closure_binder { out.add_tuple("closure_expr_closure_binders", vec![id.into(), v.into()]); } + if self.is_async { + out.add_tuple("closure_expr_is_async", vec![id.into()]); + } + if self.is_const { + out.add_tuple("closure_expr_is_const", vec![id.into()]); + } + if self.is_gen { + out.add_tuple("closure_expr_is_gen", vec![id.into()]); + } + if self.is_move { + out.add_tuple("closure_expr_is_move", vec![id.into()]); + } + if self.is_static { + out.add_tuple("closure_expr_is_static", vec![id.into()]); + } if let Some(v) = self.param_list { out.add_tuple("closure_expr_param_lists", vec![id.into(), v.into()]); } @@ -4047,6 +4085,7 @@ impl From> for trap::Label { pub struct ConstBlockPat { pub id: trap::TrapId, pub block_expr: Option>, + pub is_const: bool, } impl trap::TrapEntry for ConstBlockPat { @@ -4059,6 +4098,9 @@ impl trap::TrapEntry for ConstBlockPat { if let Some(v) = self.block_expr { out.add_tuple("const_block_pat_block_exprs", vec![id.into(), v.into()]); } + if self.is_const { + out.add_tuple("const_block_pat_is_const", vec![id.into()]); + } } } @@ -4107,6 +4149,7 @@ pub struct ConstParam { pub id: trap::TrapId, pub attrs: Vec>, pub default_val: Option>, + pub is_const: bool, pub name: Option>, pub ty: Option>, } @@ -4124,6 +4167,9 @@ impl trap::TrapEntry for ConstParam { if let Some(v) = self.default_val { out.add_tuple("const_param_default_vals", vec![id.into(), v.into()]); } + if self.is_const { + out.add_tuple("const_param_is_const", vec![id.into()]); + } if let Some(v) = self.name { out.add_tuple("const_param_names", vec![id.into(), v.into()]); } @@ -4425,6 +4471,9 @@ impl From> for trap::Label { pub struct FnPtrType { pub id: trap::TrapId, pub abi: Option>, + pub is_async: bool, + pub is_const: bool, + pub is_unsafe: bool, pub param_list: Option>, pub ret_type: Option>, } @@ -4439,6 +4488,15 @@ impl trap::TrapEntry for FnPtrType { if let Some(v) = self.abi { out.add_tuple("fn_ptr_type_abis", vec![id.into(), v.into()]); } + if self.is_async { + out.add_tuple("fn_ptr_type_is_async", vec![id.into()]); + } + if self.is_const { + out.add_tuple("fn_ptr_type_is_const", vec![id.into()]); + } + if self.is_unsafe { + out.add_tuple("fn_ptr_type_is_unsafe", vec![id.into()]); + } if let Some(v) = self.param_list { out.add_tuple("fn_ptr_type_param_lists", vec![id.into(), v.into()]); } @@ -4697,6 +4755,8 @@ impl From> for trap::Label { pub struct IdentPat { pub id: trap::TrapId, pub attrs: Vec>, + pub is_mut: bool, + pub is_ref: bool, pub name: Option>, pub pat: Option>, } @@ -4711,6 +4771,12 @@ impl trap::TrapEntry for IdentPat { for (i, v) in self.attrs.into_iter().enumerate() { out.add_tuple("ident_pat_attrs", vec![id.into(), i.into(), v.into()]); } + if self.is_mut { + out.add_tuple("ident_pat_is_mut", vec![id.into()]); + } + if self.is_ref { + out.add_tuple("ident_pat_is_ref", vec![id.into()]); + } if let Some(v) = self.name { out.add_tuple("ident_pat_names", vec![id.into(), v.into()]); } @@ -5758,81 +5824,6 @@ impl From> for trap::Label { } } -#[derive(Debug)] -pub struct MethodCallExpr { - pub id: trap::TrapId, - pub arg_list: Option>, - pub attrs: Vec>, - pub generic_arg_list: Option>, - pub name_ref: Option>, - pub receiver: Option>, -} - -impl trap::TrapEntry for MethodCallExpr { - fn extract_id(&mut self) -> trap::TrapId { - std::mem::replace(&mut self.id, trap::TrapId::Star) - } - - fn emit(self, id: trap::Label, out: &mut trap::Writer) { - out.add_tuple("method_call_exprs", vec![id.into()]); - if let Some(v) = self.arg_list { - out.add_tuple("method_call_expr_arg_lists", vec![id.into(), v.into()]); - } - for (i, v) in self.attrs.into_iter().enumerate() { - out.add_tuple("method_call_expr_attrs", vec![id.into(), i.into(), v.into()]); - } - if let Some(v) = self.generic_arg_list { - out.add_tuple("method_call_expr_generic_arg_lists", vec![id.into(), v.into()]); - } - if let Some(v) = self.name_ref { - out.add_tuple("method_call_expr_name_refs", vec![id.into(), v.into()]); - } - if let Some(v) = self.receiver { - out.add_tuple("method_call_expr_receivers", vec![id.into(), v.into()]); - } - } -} - -impl trap::TrapClass for MethodCallExpr { - fn class_name() -> &'static str { "MethodCallExpr" } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of AstNode - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of Element - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of Expr - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - -impl From> for trap::Label { - fn from(value: trap::Label) -> Self { - // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of Locatable - unsafe { - Self::from_untyped(value.as_untyped()) - } - } -} - #[derive(Debug)] pub struct NeverType { pub id: trap::TrapId, @@ -6446,6 +6437,8 @@ impl From> for trap::Label { #[derive(Debug)] pub struct PtrType { pub id: trap::TrapId, + pub is_const: bool, + pub is_mut: bool, pub ty: Option>, } @@ -6456,6 +6449,12 @@ impl trap::TrapEntry for PtrType { fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("ptr_types", vec![id.into()]); + if self.is_const { + out.add_tuple("ptr_type_is_const", vec![id.into()]); + } + if self.is_mut { + out.add_tuple("ptr_type_is_mut", vec![id.into()]); + } if let Some(v) = self.ty { out.add_tuple("ptr_type_ties", vec![id.into(), v.into()]); } @@ -6830,6 +6829,9 @@ pub struct RefExpr { pub id: trap::TrapId, pub attrs: Vec>, pub expr: Option>, + pub is_const: bool, + pub is_mut: bool, + pub is_raw: bool, } impl trap::TrapEntry for RefExpr { @@ -6845,6 +6847,15 @@ impl trap::TrapEntry for RefExpr { if let Some(v) = self.expr { out.add_tuple("ref_expr_exprs", vec![id.into(), v.into()]); } + if self.is_const { + out.add_tuple("ref_expr_is_const", vec![id.into()]); + } + if self.is_mut { + out.add_tuple("ref_expr_is_mut", vec![id.into()]); + } + if self.is_raw { + out.add_tuple("ref_expr_is_raw", vec![id.into()]); + } } } @@ -6891,6 +6902,7 @@ impl From> for trap::Label { #[derive(Debug)] pub struct RefPat { pub id: trap::TrapId, + pub is_mut: bool, pub pat: Option>, } @@ -6901,6 +6913,9 @@ impl trap::TrapEntry for RefPat { fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("ref_pats", vec![id.into()]); + if self.is_mut { + out.add_tuple("ref_pat_is_mut", vec![id.into()]); + } if let Some(v) = self.pat { out.add_tuple("ref_pat_pats", vec![id.into(), v.into()]); } @@ -6950,6 +6965,7 @@ impl From> for trap::Label { #[derive(Debug)] pub struct RefType { pub id: trap::TrapId, + pub is_mut: bool, pub lifetime: Option>, pub ty: Option>, } @@ -6961,6 +6977,9 @@ impl trap::TrapEntry for RefType { fn emit(self, id: trap::Label, out: &mut trap::Writer) { out.add_tuple("ref_types", vec![id.into()]); + if self.is_mut { + out.add_tuple("ref_type_is_mut", vec![id.into()]); + } if let Some(v) = self.lifetime { out.add_tuple("ref_type_lifetimes", vec![id.into(), v.into()]); } @@ -8057,11 +8076,89 @@ impl From> for trap::Label { } } +#[derive(Debug)] +pub struct CallExpr { + pub id: trap::TrapId, + pub arg_list: Option>, + pub attrs: Vec>, + pub expr: Option>, +} + +impl trap::TrapEntry for CallExpr { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("call_exprs", vec![id.into()]); + if let Some(v) = self.arg_list { + out.add_tuple("call_expr_base_arg_lists", vec![id.into(), v.into()]); + } + for (i, v) in self.attrs.into_iter().enumerate() { + out.add_tuple("call_expr_base_attrs", vec![id.into(), i.into(), v.into()]); + } + if let Some(v) = self.expr { + out.add_tuple("call_expr_exprs", vec![id.into(), v.into()]); + } + } +} + +impl trap::TrapClass for CallExpr { + fn class_name() -> &'static str { "CallExpr" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of CallExprBase + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of Expr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme CallExpr is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct Const { pub id: trap::TrapId, pub attrs: Vec>, pub body: Option>, + pub is_const: bool, + pub is_default: bool, pub name: Option>, pub ty: Option>, pub visibility: Option>, @@ -8080,6 +8177,12 @@ impl trap::TrapEntry for Const { if let Some(v) = self.body { out.add_tuple("const_bodies", vec![id.into(), v.into()]); } + if self.is_const { + out.add_tuple("const_is_const", vec![id.into()]); + } + if self.is_default { + out.add_tuple("const_is_default", vec![id.into()]); + } if let Some(v) = self.name { out.add_tuple("const_names", vec![id.into(), v.into()]); } @@ -8244,6 +8347,7 @@ pub struct ExternBlock { pub abi: Option>, pub attrs: Vec>, pub extern_item_list: Option>, + pub is_unsafe: bool, } impl trap::TrapEntry for ExternBlock { @@ -8262,6 +8366,9 @@ impl trap::TrapEntry for ExternBlock { if let Some(v) = self.extern_item_list { out.add_tuple("extern_block_extern_item_lists", vec![id.into(), v.into()]); } + if self.is_unsafe { + out.add_tuple("extern_block_is_unsafe", vec![id.into()]); + } } } @@ -8401,6 +8508,11 @@ pub struct Function { pub attrs: Vec>, pub body: Option>, pub generic_param_list: Option>, + pub is_async: bool, + pub is_const: bool, + pub is_default: bool, + pub is_gen: bool, + pub is_unsafe: bool, pub name: Option>, pub param_list: Option>, pub ret_type: Option>, @@ -8427,6 +8539,21 @@ impl trap::TrapEntry for Function { if let Some(v) = self.generic_param_list { out.add_tuple("function_generic_param_lists", vec![id.into(), v.into()]); } + if self.is_async { + out.add_tuple("function_is_async", vec![id.into()]); + } + if self.is_const { + out.add_tuple("function_is_const", vec![id.into()]); + } + if self.is_default { + out.add_tuple("function_is_default", vec![id.into()]); + } + if self.is_gen { + out.add_tuple("function_is_gen", vec![id.into()]); + } + if self.is_unsafe { + out.add_tuple("function_is_unsafe", vec![id.into()]); + } if let Some(v) = self.name { out.add_tuple("function_names", vec![id.into(), v.into()]); } @@ -8518,6 +8645,9 @@ pub struct Impl { pub assoc_item_list: Option>, pub attrs: Vec>, pub generic_param_list: Option>, + pub is_const: bool, + pub is_default: bool, + pub is_unsafe: bool, pub self_ty: Option>, pub trait_: Option>, pub visibility: Option>, @@ -8540,6 +8670,15 @@ impl trap::TrapEntry for Impl { if let Some(v) = self.generic_param_list { out.add_tuple("impl_generic_param_lists", vec![id.into(), v.into()]); } + if self.is_const { + out.add_tuple("impl_is_const", vec![id.into()]); + } + if self.is_default { + out.add_tuple("impl_is_default", vec![id.into()]); + } + if self.is_unsafe { + out.add_tuple("impl_is_unsafe", vec![id.into()]); + } if let Some(v) = self.self_ty { out.add_tuple("impl_self_ties", vec![id.into(), v.into()]); } @@ -8868,6 +9007,90 @@ impl From> for trap::Label { } } +#[derive(Debug)] +pub struct MethodCallExpr { + pub id: trap::TrapId, + pub arg_list: Option>, + pub attrs: Vec>, + pub generic_arg_list: Option>, + pub name_ref: Option>, + pub receiver: Option>, +} + +impl trap::TrapEntry for MethodCallExpr { + fn extract_id(&mut self) -> trap::TrapId { + std::mem::replace(&mut self.id, trap::TrapId::Star) + } + + fn emit(self, id: trap::Label, out: &mut trap::Writer) { + out.add_tuple("method_call_exprs", vec![id.into()]); + if let Some(v) = self.arg_list { + out.add_tuple("call_expr_base_arg_lists", vec![id.into(), v.into()]); + } + for (i, v) in self.attrs.into_iter().enumerate() { + out.add_tuple("call_expr_base_attrs", vec![id.into(), i.into(), v.into()]); + } + if let Some(v) = self.generic_arg_list { + out.add_tuple("method_call_expr_generic_arg_lists", vec![id.into(), v.into()]); + } + if let Some(v) = self.name_ref { + out.add_tuple("method_call_expr_name_refs", vec![id.into(), v.into()]); + } + if let Some(v) = self.receiver { + out.add_tuple("method_call_expr_receivers", vec![id.into(), v.into()]); + } + } +} + +impl trap::TrapClass for MethodCallExpr { + fn class_name() -> &'static str { "MethodCallExpr" } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of AstNode + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of CallExprBase + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of Element + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of Expr + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + +impl From> for trap::Label { + fn from(value: trap::Label) -> Self { + // SAFETY: this is safe because in the dbscheme MethodCallExpr is a subclass of Locatable + unsafe { + Self::from_untyped(value.as_untyped()) + } + } +} + #[derive(Debug)] pub struct Module { pub id: trap::TrapId, @@ -8953,6 +9176,8 @@ pub struct Static { pub id: trap::TrapId, pub attrs: Vec>, pub body: Option>, + pub is_mut: bool, + pub is_static: bool, pub name: Option>, pub ty: Option>, pub visibility: Option>, @@ -8971,6 +9196,12 @@ impl trap::TrapEntry for Static { if let Some(v) = self.body { out.add_tuple("static_bodies", vec![id.into(), v.into()]); } + if self.is_mut { + out.add_tuple("static_is_mut", vec![id.into()]); + } + if self.is_static { + out.add_tuple("static_is_static", vec![id.into()]); + } if let Some(v) = self.name { out.add_tuple("static_names", vec![id.into(), v.into()]); } @@ -9135,6 +9366,8 @@ pub struct Trait { pub assoc_item_list: Option>, pub attrs: Vec>, pub generic_param_list: Option>, + pub is_auto: bool, + pub is_unsafe: bool, pub name: Option>, pub type_bound_list: Option>, pub visibility: Option>, @@ -9157,6 +9390,12 @@ impl trap::TrapEntry for Trait { if let Some(v) = self.generic_param_list { out.add_tuple("trait_generic_param_lists", vec![id.into(), v.into()]); } + if self.is_auto { + out.add_tuple("trait_is_auto", vec![id.into()]); + } + if self.is_unsafe { + out.add_tuple("trait_is_unsafe", vec![id.into()]); + } if let Some(v) = self.name { out.add_tuple("trait_names", vec![id.into(), v.into()]); } @@ -9314,6 +9553,7 @@ pub struct TypeAlias { pub id: trap::TrapId, pub attrs: Vec>, pub generic_param_list: Option>, + pub is_default: bool, pub name: Option>, pub ty: Option>, pub type_bound_list: Option>, @@ -9334,6 +9574,9 @@ impl trap::TrapEntry for TypeAlias { if let Some(v) = self.generic_param_list { out.add_tuple("type_alias_generic_param_lists", vec![id.into(), v.into()]); } + if self.is_default { + out.add_tuple("type_alias_is_default", vec![id.into()]); + } if let Some(v) = self.name { out.add_tuple("type_alias_names", vec![id.into(), v.into()]); } diff --git a/rust/extractor/src/translate/generated.rs b/rust/extractor/src/translate/generated.rs index 195cb59b73f5..d548d26c290a 100644 --- a/rust/extractor/src/translate/generated.rs +++ b/rust/extractor/src/translate/generated.rs @@ -339,11 +339,23 @@ impl Translator<'_> { pub(crate) fn emit_block_expr(&mut self, node: ast::BlockExpr) -> Label { let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); + let is_async = node.async_token().is_some(); + let is_const = node.const_token().is_some(); + let is_gen = node.gen_token().is_some(); + let is_move = node.move_token().is_some(); + let is_try = node.try_token().is_some(); + let is_unsafe = node.unsafe_token().is_some(); let label = node.label().map(|x| self.emit_label(x)); let stmt_list = node.stmt_list().map(|x| self.emit_stmt_list(x)); let label = self.trap.emit(generated::BlockExpr { id: TrapId::Star, attrs, + is_async, + is_const, + is_gen, + is_move, + is_try, + is_unsafe, label, stmt_list, }); @@ -429,6 +441,11 @@ impl Translator<'_> { let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); let body = node.body().map(|x| self.emit_expr(x)); let closure_binder = node.closure_binder().map(|x| self.emit_closure_binder(x)); + let is_async = node.async_token().is_some(); + let is_const = node.const_token().is_some(); + let is_gen = node.gen_token().is_some(); + let is_move = node.move_token().is_some(); + let is_static = node.static_token().is_some(); let param_list = node.param_list().map(|x| self.emit_param_list(x)); let ret_type = node.ret_type().map(|x| self.emit_ret_type(x)); let label = self.trap.emit(generated::ClosureExpr { @@ -436,6 +453,11 @@ impl Translator<'_> { attrs, body, closure_binder, + is_async, + is_const, + is_gen, + is_move, + is_static, param_list, ret_type, }); @@ -448,6 +470,8 @@ impl Translator<'_> { pub(crate) fn emit_const(&mut self, node: ast::Const) -> Label { let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); let body = node.body().map(|x| self.emit_expr(x)); + let is_const = node.const_token().is_some(); + let is_default = node.default_token().is_some(); let name = node.name().map(|x| self.emit_name(x)); let ty = node.ty().map(|x| self.emit_type(x)); let visibility = node.visibility().map(|x| self.emit_visibility(x)); @@ -455,6 +479,8 @@ impl Translator<'_> { id: TrapId::Star, attrs, body, + is_const, + is_default, name, ty, visibility, @@ -479,9 +505,11 @@ impl Translator<'_> { pub(crate) fn emit_const_block_pat(&mut self, node: ast::ConstBlockPat) -> Label { let block_expr = node.block_expr().map(|x| self.emit_block_expr(x)); + let is_const = node.const_token().is_some(); let label = self.trap.emit(generated::ConstBlockPat { id: TrapId::Star, block_expr, + is_const, }); self.emit_location(label, &node); emit_detached!(ConstBlockPat, self, node, label); @@ -492,12 +520,14 @@ impl Translator<'_> { pub(crate) fn emit_const_param(&mut self, node: ast::ConstParam) -> Label { let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); let default_val = node.default_val().map(|x| self.emit_const_arg(x)); + let is_const = node.const_token().is_some(); let name = node.name().map(|x| self.emit_name(x)); let ty = node.ty().map(|x| self.emit_type(x)); let label = self.trap.emit(generated::ConstParam { id: TrapId::Star, attrs, default_val, + is_const, name, ty, }); @@ -571,11 +601,13 @@ impl Translator<'_> { let abi = node.abi().map(|x| self.emit_abi(x)); let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); let extern_item_list = node.extern_item_list().map(|x| self.emit_extern_item_list(x)); + let is_unsafe = node.unsafe_token().is_some(); let label = self.trap.emit(generated::ExternBlock { id: TrapId::Star, abi, attrs, extern_item_list, + is_unsafe, }); self.emit_location(label, &node); emit_detached!(ExternBlock, self, node, label); @@ -636,6 +668,11 @@ impl Translator<'_> { let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); let body = node.body().map(|x| self.emit_block_expr(x)); let generic_param_list = node.generic_param_list().map(|x| self.emit_generic_param_list(x)); + let is_async = node.async_token().is_some(); + let is_const = node.const_token().is_some(); + let is_default = node.default_token().is_some(); + let is_gen = node.gen_token().is_some(); + let is_unsafe = node.unsafe_token().is_some(); let name = node.name().map(|x| self.emit_name(x)); let param_list = node.param_list().map(|x| self.emit_param_list(x)); let ret_type = node.ret_type().map(|x| self.emit_ret_type(x)); @@ -647,6 +684,11 @@ impl Translator<'_> { attrs, body, generic_param_list, + is_async, + is_const, + is_default, + is_gen, + is_unsafe, name, param_list, ret_type, @@ -661,11 +703,17 @@ impl Translator<'_> { pub(crate) fn emit_fn_ptr_type(&mut self, node: ast::FnPtrType) -> Label { let abi = node.abi().map(|x| self.emit_abi(x)); + let is_async = node.async_token().is_some(); + let is_const = node.const_token().is_some(); + let is_unsafe = node.unsafe_token().is_some(); let param_list = node.param_list().map(|x| self.emit_param_list(x)); let ret_type = node.ret_type().map(|x| self.emit_ret_type(x)); let label = self.trap.emit(generated::FnPtrType { id: TrapId::Star, abi, + is_async, + is_const, + is_unsafe, param_list, ret_type, }); @@ -765,11 +813,15 @@ impl Translator<'_> { pub(crate) fn emit_ident_pat(&mut self, node: ast::IdentPat) -> Label { let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); + let is_mut = node.mut_token().is_some(); + let is_ref = node.ref_token().is_some(); let name = node.name().map(|x| self.emit_name(x)); let pat = node.pat().map(|x| self.emit_pat(x)); let label = self.trap.emit(generated::IdentPat { id: TrapId::Star, attrs, + is_mut, + is_ref, name, pat, }); @@ -801,6 +853,9 @@ impl Translator<'_> { let assoc_item_list = node.assoc_item_list().map(|x| self.emit_assoc_item_list(x)); let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); let generic_param_list = node.generic_param_list().map(|x| self.emit_generic_param_list(x)); + let is_const = node.const_token().is_some(); + let is_default = node.default_token().is_some(); + let is_unsafe = node.unsafe_token().is_some(); let self_ty = node.self_ty().map(|x| self.emit_type(x)); let trait_ = node.trait_().map(|x| self.emit_type(x)); let visibility = node.visibility().map(|x| self.emit_visibility(x)); @@ -810,6 +865,9 @@ impl Translator<'_> { assoc_item_list, attrs, generic_param_list, + is_const, + is_default, + is_unsafe, self_ty, trait_, visibility, @@ -1193,11 +1251,13 @@ impl Translator<'_> { pub(crate) fn emit_meta(&mut self, node: ast::Meta) -> Label { let expr = node.expr().map(|x| self.emit_expr(x)); + let is_unsafe = node.unsafe_token().is_some(); let path = node.path().map(|x| self.emit_path(x)); let token_tree = node.token_tree().map(|x| self.emit_token_tree(x)); let label = self.trap.emit(generated::Meta { id: TrapId::Star, expr, + is_unsafe, path, token_tree, }); @@ -1468,9 +1528,13 @@ impl Translator<'_> { } pub(crate) fn emit_ptr_type(&mut self, node: ast::PtrType) -> Label { + let is_const = node.const_token().is_some(); + let is_mut = node.mut_token().is_some(); let ty = node.ty().map(|x| self.emit_type(x)); let label = self.trap.emit(generated::PtrType { id: TrapId::Star, + is_const, + is_mut, ty, }); self.emit_location(label, &node); @@ -1636,10 +1700,16 @@ impl Translator<'_> { pub(crate) fn emit_ref_expr(&mut self, node: ast::RefExpr) -> Label { let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); let expr = node.expr().map(|x| self.emit_expr(x)); + let is_const = node.const_token().is_some(); + let is_mut = node.mut_token().is_some(); + let is_raw = node.raw_token().is_some(); let label = self.trap.emit(generated::RefExpr { id: TrapId::Star, attrs, expr, + is_const, + is_mut, + is_raw, }); self.emit_location(label, &node); emit_detached!(RefExpr, self, node, label); @@ -1648,9 +1718,11 @@ impl Translator<'_> { } pub(crate) fn emit_ref_pat(&mut self, node: ast::RefPat) -> Label { + let is_mut = node.mut_token().is_some(); let pat = node.pat().map(|x| self.emit_pat(x)); let label = self.trap.emit(generated::RefPat { id: TrapId::Star, + is_mut, pat, }); self.emit_location(label, &node); @@ -1660,10 +1732,12 @@ impl Translator<'_> { } pub(crate) fn emit_ref_type(&mut self, node: ast::RefType) -> Label { + let is_mut = node.mut_token().is_some(); let lifetime = node.lifetime().map(|x| self.emit_lifetime(x)); let ty = node.ty().map(|x| self.emit_type(x)); let label = self.trap.emit(generated::RefType { id: TrapId::Star, + is_mut, lifetime, ty, }); @@ -1735,12 +1809,14 @@ impl Translator<'_> { pub(crate) fn emit_self_param(&mut self, node: ast::SelfParam) -> Label { let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); + let is_mut = node.mut_token().is_some(); let lifetime = node.lifetime().map(|x| self.emit_lifetime(x)); let name = node.name().map(|x| self.emit_name(x)); let ty = node.ty().map(|x| self.emit_type(x)); let label = self.trap.emit(generated::SelfParam { id: TrapId::Star, attrs, + is_mut, lifetime, name, ty, @@ -1792,6 +1868,8 @@ impl Translator<'_> { pub(crate) fn emit_static(&mut self, node: ast::Static) -> Label { let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); let body = node.body().map(|x| self.emit_expr(x)); + let is_mut = node.mut_token().is_some(); + let is_static = node.static_token().is_some(); let name = node.name().map(|x| self.emit_name(x)); let ty = node.ty().map(|x| self.emit_type(x)); let visibility = node.visibility().map(|x| self.emit_visibility(x)); @@ -1799,6 +1877,8 @@ impl Translator<'_> { id: TrapId::Star, attrs, body, + is_mut, + is_static, name, ty, visibility, @@ -1861,6 +1941,8 @@ impl Translator<'_> { let assoc_item_list = node.assoc_item_list().map(|x| self.emit_assoc_item_list(x)); let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); let generic_param_list = node.generic_param_list().map(|x| self.emit_generic_param_list(x)); + let is_auto = node.auto_token().is_some(); + let is_unsafe = node.unsafe_token().is_some(); let name = node.name().map(|x| self.emit_name(x)); let type_bound_list = node.type_bound_list().map(|x| self.emit_type_bound_list(x)); let visibility = node.visibility().map(|x| self.emit_visibility(x)); @@ -1870,6 +1952,8 @@ impl Translator<'_> { assoc_item_list, attrs, generic_param_list, + is_auto, + is_unsafe, name, type_bound_list, visibility, @@ -2000,6 +2084,7 @@ impl Translator<'_> { pub(crate) fn emit_type_alias(&mut self, node: ast::TypeAlias) -> Label { let attrs = node.attrs().map(|x| self.emit_attr(x)).collect(); let generic_param_list = node.generic_param_list().map(|x| self.emit_generic_param_list(x)); + let is_default = node.default_token().is_some(); let name = node.name().map(|x| self.emit_name(x)); let ty = node.ty().map(|x| self.emit_type(x)); let type_bound_list = node.type_bound_list().map(|x| self.emit_type_bound_list(x)); @@ -2009,6 +2094,7 @@ impl Translator<'_> { id: TrapId::Star, attrs, generic_param_list, + is_default, name, ty, type_bound_list, @@ -2035,11 +2121,15 @@ impl Translator<'_> { pub(crate) fn emit_type_bound(&mut self, node: ast::TypeBound) -> Label { let generic_param_list = node.generic_param_list().map(|x| self.emit_generic_param_list(x)); + let is_async = node.async_token().is_some(); + let is_const = node.const_token().is_some(); let lifetime = node.lifetime().map(|x| self.emit_lifetime(x)); let ty = node.ty().map(|x| self.emit_type(x)); let label = self.trap.emit(generated::TypeBound { id: TrapId::Star, generic_param_list, + is_async, + is_const, lifetime, ty, }); diff --git a/rust/ql/.generated.list b/rust/ql/.generated.list index bb8b04642539..c03d4975a91e 100644 --- a/rust/ql/.generated.list +++ b/rust/ql/.generated.list @@ -14,7 +14,8 @@ lib/codeql/rust/elements/BinaryExpr.qll 394522da3bc3a716fc7bc40c3560143ca840f5d2 lib/codeql/rust/elements/BlockExpr.qll b952fd44b89de248931d4089834d2c9406f6f2fc1a3f5c2365156be4e55157cf daccc07ab11ac696679b9fadc99f40b1bf579c90bf6c7cca6e82eaa313932ede lib/codeql/rust/elements/BoxPat.qll 1b2c3fff171aa6aa238c9460b122f26c79e04577cea67fa856de99842ba873d4 0caf8d23ed6e0997a6b8751def27641582151fba6e24fccf798712a4690b42f1 lib/codeql/rust/elements/BreakExpr.qll 7ca3807a20e9a9a988d1fd7abebf240325ed422fcb45c719ba46272f031f94db dffb7379d3f3ba220acfbd05eb7bb6cfd9cfda211e9c8b1f5240ca5fa61be3fc -lib/codeql/rust/elements/CallExpr.qll 6760ef2753fcaa9f02860bfeadfd1b1603d0d5b35f5dd72b33a474c206f51a29 55afe003eb51ef28b382af368429930d858d291bb7d76d71149eee1c805731f1 +lib/codeql/rust/elements/CallExpr.qll f336500ca7a611b164d48b90e80edb0c0d3816792b0ececce659ac1ff1ffeb3e f99a9c55466418ef53860c44d9f2d6161af4b492178ddd9e5870dff742b70ae5 +lib/codeql/rust/elements/CallExprBase.qll 2846202b5208b541977500286951d96487bf555838c6c16cdd006a71e383745a c789d412bf099c624329379e0c7d94fa0d23ae2edea7a25a2ea0f3c0042ccf62 lib/codeql/rust/elements/CastExpr.qll ba281bde130f43c486c4ad889539b77fba9e41afdf7980e50b6a8696a1ec7527 61257003d395896ec60729d0bc01da36697615bb725d07141255fbb5c44e50a0 lib/codeql/rust/elements/ClosureBinder.qll 977df800f97cc9b03fffb5e5e1fc6acd08a2938e04cb6ad91108784a15b0d510 f6fad4127226fe1dff2f16416d8a7fde5d8ab4a88f30e443ac5e5ff618de3e05 lib/codeql/rust/elements/ClosureExpr.qll 8f06357ae134e42c073eef994c83c04b8cf294fe33b286dbd75c0e705ce29d05 9d9e282d965fed723965376801d4afa49444d1d9be9b093d02e276729a2cf7ad @@ -77,7 +78,7 @@ lib/codeql/rust/elements/MatchArmList.qll e6c48fd7419d88e996b82eb45e4aa2686dfd07 lib/codeql/rust/elements/MatchExpr.qll e9ef1664f020823b6f4bb72d906a9dc0c1ee6432d4a9a13f7dbdbab2b2b1ee4d 38d71e5c487abcb5682293c573343be66e499a6e131bb630604c120d34b7777b lib/codeql/rust/elements/MatchGuard.qll 20754ab2009a7d40b50feece496ff7f38650586d79190ed2a372308594693694 471f8f118317efcf112f4ddfd60125ca2a9d9b3b08e6ee331c430961de7885ff lib/codeql/rust/elements/Meta.qll 9fa3216c86fa55ed5c0c4671708110a6ffc7c0f5d6cda8dda31aaff17f87534d c44ee2754dd71776ffd0a8a7d6c1ae8737c47e998e6bdb8efab5283625807cf4 -lib/codeql/rust/elements/MethodCallExpr.qll 0a5cab9f21741f6a38956e6de4f6beb143db5d85ee590f9908dab3da300a6b72 df21eba9cf2823a7b06eb6672dd8249225e7c16d5b6c1c37c1f2a175d9513272 +lib/codeql/rust/elements/MethodCallExpr.qll 91b411e0fb1a0547dcad8726db460dccc61bed972741598d5cb3740593fe75a7 538d23b6db115bb699389d29a1829bb0449c08424a1fff80377828eb7ceb2563 lib/codeql/rust/elements/Missing.qll 70e6ac9790314752849c9888443c98223ccfc93a193998b7ce350b2c6ebe8ea4 e2f0623511acaa76b091f748d417714137a8b94f1f2bdbbd177f1c682c786dad lib/codeql/rust/elements/Module.qll 0bc85019177709256f8078d9de2a36f62f848d476225bff7bba1e35f249875c7 3fbb70e0c417a644dd0cada2c364c6e6876cfa16f37960e219c87e49c966c94e lib/codeql/rust/elements/Name.qll 3d7ed16c232912e30e5a075f5087ad344a8f76dcc27bc8f71a80c133802b89d7 036dc3ba0c20eb0907ef6dcc532214aa5de8e0de0fa819eca1fce0355b3741a3 @@ -185,6 +186,7 @@ lib/codeql/rust/elements/internal/BlockExprImpl.qll 36ac09e4a6eeeec22919b62b1d00 lib/codeql/rust/elements/internal/BoxPatConstructor.qll 153f110ba25fd6c889092bfd16f73bb610fa60d6e0c8965d5f44d2446fcd48a2 9324cf0d8aa29945551bf8ab64801d598f57aab8cd4e19bcd4e9ef8a4a4e06eb lib/codeql/rust/elements/internal/BoxPatImpl.qll d62a3cc1d5bab6bd258f702ec731ec57f0e5ef2672ab9de4b6f3b558078629eb 26b4fabb676adbbdb0d7f81449e493ee49380ea04d131f779714ac2434bb323a lib/codeql/rust/elements/internal/BreakExprConstructor.qll 356be043c28e0b34fdf925a119c945632ee883c6f5ebb9a27003c6a8d250afd9 bb77e66b04bb9489340e7506931559b94285c6904b6f9d2f83b214cba4f3cfd5 +lib/codeql/rust/elements/internal/CallExprBaseImpl.qll d2749cc1a9d7ee8bf7f34b6c3e0238a576a68e439a8c10a503c164ff45ffcbeb ffc7b0a8841945fe6736b0e1aed7d9ed69185db03dee2b16da121325b39397c7 lib/codeql/rust/elements/internal/CallExprConstructor.qll 742b38e862e2cf82fd1ecc4d4fc5b4782a9c7c07f031452b2bae7aa59d5aa13a cad6e0a8be21d91b20ac2ec16cab9c30eae810b452c0f1992ed87d5c7f4144dc lib/codeql/rust/elements/internal/CallExprImpl.qll 7e48610680ba6f2876a1a005ab0743496dd2364b9c44aca441bd33e11317e2d7 bb12c3c28156b40796fe3ba112760f87bb5abb323aab3c5b7bb3e0facaef8d35 lib/codeql/rust/elements/internal/CastExprConstructor.qll f3d6e10c4731f38a384675aeab3fba47d17b9e15648293787092bb3247ed808d d738a7751dbadb70aa1dcffcf8af7fa61d4cf8029798369a7e8620013afff4ed @@ -462,43 +464,44 @@ lib/codeql/rust/elements/internal/generated/Attr.qll 2e7983b2c462750065ed58cc10c lib/codeql/rust/elements/internal/generated/AwaitExpr.qll 1d71af702a1f397fb231fae3e0642b3deeba0cd5a43c1d8fabdff29cac979340 e0bfa007bdecc5a09a266d449d723ae35f5a24fbdfc11e4e48aeea3ec0c5147c lib/codeql/rust/elements/internal/generated/BecomeExpr.qll 7a211b785a4a2f961242d1d73fd031d381aad809f7b600ce7f7f864518bb7242 17a0388680007871748cfdc6621f700a7c2817b9601e1bd817fb48561e7c63ad lib/codeql/rust/elements/internal/generated/BinaryExpr.qll 64e9bd9c571edd6e5f3e7662b956b1d87fa0354ce6fe95da9caf25ac16b66c68 3fca09fdbe879db2ca3293618896a462e96376a2963d15cce3d5b1baac552fcb -lib/codeql/rust/elements/internal/generated/BlockExpr.qll 6fc90a80e60f017bf3418e45bcc35b5ddac59b51037c21aed3955d47c147ce4a 1f3f8e5107b0c6de381b7c94aab93dc5fd758a845c6ff9554888df453f1315d0 +lib/codeql/rust/elements/internal/generated/BlockExpr.qll ccfbdc7bd268735a0424ff08dcf37d0e1fed61d5fe0520593c23f2490d400438 0facad59f6aba13ee0c069b691c99f52c04b723a2bfad4da226190c3c42dcabf lib/codeql/rust/elements/internal/generated/BoxPat.qll ec946a3e671ab7417e04b0207967adad004df512c570c4f0780ca5816d12d75f b0e64860855c4e85914042b1a51034899ff7cd1b2c6857188de89310a2726ea3 lib/codeql/rust/elements/internal/generated/BreakExpr.qll 0f428a8b2f4209b134c2ffc3e1c93c30bc6b0e9c9172f140cefa88c1f77d8690 957b39f38ff6befe9061f55bc0b403c2f1c366dd0cf63b874bae6f8216576d76 -lib/codeql/rust/elements/internal/generated/CallExpr.qll c2700dbd9c33dcc14de10dc72ff49abafdf0952257864d4435cf8ac46849a2ee 7932f725f97ffbe1b050c2622a61a0d56f18c9264a3293466cba9915313495b5 +lib/codeql/rust/elements/internal/generated/CallExpr.qll 23ee64e3bf643cd5e6ff705181d2bb31e1aeaffecb5bdce73836172dbf15f12f 34b280139b1f8f70d78e1432392f03c971be392e8cb68d014eb325d0c101bddd +lib/codeql/rust/elements/internal/generated/CallExprBase.qll cce796e36847249f416629bacf3ea146313084de3374587412e66c10d2917b83 c219aa2174321c161a4a742ca0605521687ca9a5ca32db453a5c62db6f7784cc lib/codeql/rust/elements/internal/generated/CastExpr.qll d6fbf02e9e202254666082a9116634d0eb933177866ac4c0a57b5e9c4bb4b383 477f67773492e3b82695461d56327c9db05a7d1a67e8d192406265f2ce369670 lib/codeql/rust/elements/internal/generated/ClosureBinder.qll 94c0dcdd4cd87d115659d496c88a98354bc7d4ddc0fa27028003bf7688b99987 d59d713b426dbbdb775df9092d176eea031dac1f14e468810f2fc8591399cd19 -lib/codeql/rust/elements/internal/generated/ClosureExpr.qll f9047451cb8b53f8b77e1c01f7ef485d5b5a92999e0591c6702062050052fa2f 2252be8b3022c587a8c6ad93b64d856263be7bfe2938c1d063e7cad845dd38e2 +lib/codeql/rust/elements/internal/generated/ClosureExpr.qll a10596deeb7b9799f0c0d9e9dfe43f5ff58ba03a9a444d581a240a99ca06a949 e94c2f6cd0190d108d0b91340227d45fb6b8c8c2c6a0476358fe75ea7f7a7760 lib/codeql/rust/elements/internal/generated/Comment.qll cd1ef861e3803618f9f78a4ac00516d50ecfecdca1c1d14304dc5327cbe07a3b 8b67345aeb15beb5895212228761ea3496297846c93fd2127b417406ae87c201 -lib/codeql/rust/elements/internal/generated/Const.qll 0dbea9732880a4583166714d077276ec2b5665fa9772ea4284ee7b3f3d567923 38efc474b76f0b13695e9d9b39d016200c251fd9db48d4a1ab27dcb38946ca72 +lib/codeql/rust/elements/internal/generated/Const.qll 40464df9d8baacbc85bd137c7d1661684c957c407b2363ea60d90946be93de4c a3316beae55f570a5ca4b1172ef8267d7acb1104cc7a5e9efc58d9fc8224500f lib/codeql/rust/elements/internal/generated/ConstArg.qll e2451cac6ee464f5b64883d60d534996fcff061a520517ac792116238a11e185 1dd6d4b073b0970448a52bbe2468cd160dfe108971dbf9ae9305900bd22ef146 -lib/codeql/rust/elements/internal/generated/ConstBlockPat.qll e90cf24d7f995595111f2b48bd3775d064bc968c24074c122141aa0f058dcb83 a44f6e14da8cc760a0aae947c20ec47fff488da1e9a8dfab58b7dbc42c296fec -lib/codeql/rust/elements/internal/generated/ConstParam.qll cc34626ea28b8bf4dbf2c2dd312b778e43a9725722039a8ba393ddd7267a951a e3c2983a794b4d623191db97616c3167b80aa847317685960919e03aac0d044b +lib/codeql/rust/elements/internal/generated/ConstBlockPat.qll a425a7fd216d35f17a7ff239d431b349721f71f2e52722325755f43df2bb9886 a9aa37ee4f8c9d44ae49c807ac48d5a8a22f7d7d0ae2968ab50371a418ccc48a +lib/codeql/rust/elements/internal/generated/ConstParam.qll 26f838dbbd7659cdbf464c2107304b66ad0fbd43370d6b649373c3b9fa4f6576 c658951ba92b919278fa445cd66c3b694f42d76bde49daa50a3128e5d44f647a lib/codeql/rust/elements/internal/generated/ContinueExpr.qll e2010feb14fb6edeb83a991d9357e50edb770172ddfde2e8670b0d3e68169f28 48d09d661e1443002f6d22b8710e22c9c36d9daa9cde09c6366a61e960d717cb lib/codeql/rust/elements/internal/generated/DynTraitType.qll da9dce6347ce385d7468986cf6960b4a6787f017ff5632612a7216ed62bdc9c9 9d0b37221674b597a21bfacbdfc7e08b54381a6adacfe544df154481cd562ed8 lib/codeql/rust/elements/internal/generated/Element.qll fb483b636180c699181c8aff83bc471b2c416206694f7028c671015918547663 542d1b9ae80c997974c94db3655887186df3921a8fa3f565eaf292dcfdac3c4c lib/codeql/rust/elements/internal/generated/Enum.qll 4f4cbc9cd758c20d476bc767b916c62ba434d1750067d0ffb63e0821bb95ec86 3da735d54022add50cec0217bbf8ec4cf29b47f4851ee327628bcdd6454989d0 lib/codeql/rust/elements/internal/generated/Expr.qll 5fa34f2ed21829a1509417440dae42d416234ff43433002974328e7aabb8f30f 46f3972c7413b7db28a3ea8acb5a50a74b6dd9b658e8725f6953a8829ac912f8 lib/codeql/rust/elements/internal/generated/ExprStmt.qll d1112230015fbeb216b43407a268dc2ccd0f9e0836ab2dca4800c51b38fa1d7d 4a80562dcc55efa5e72c6c3b1d6747ab44fe494e76faff2b8f6e9f10a4b08b5b -lib/codeql/rust/elements/internal/generated/ExternBlock.qll a8ba7dec266603ef1e3908f923a497bd1e206ec729cfd4ad397ef4502fddc745 cc20b5a47466dab52a8d57c1b3c99b09c01420967670c2e75d3f90302ced2dbb +lib/codeql/rust/elements/internal/generated/ExternBlock.qll c292d804a1f8d2cf6a443be701640c4e87410662921e026d3553bc624fd18abd ba6fae821d2502a97dec636e2d70476ad0693bc6185ae50e8391699529bd0ee0 lib/codeql/rust/elements/internal/generated/ExternCrate.qll 35fea4e810a896c1656adb4682c4c3bc20283768073e26ae064189ce310433c8 fc504dff79ba758d89b10cd5049539fbc766ee9862ff495066cea26abf0b5e0b lib/codeql/rust/elements/internal/generated/ExternItem.qll 749b064ad60f32197d5b85e25929afe18e56e12f567b73e21e43e2fdf4c447e3 e2c2d423876675cf2dae399ca442aef7b2860319da9bfadeff29f2c6946f8de7 lib/codeql/rust/elements/internal/generated/ExternItemList.qll 6bc97fdae6c411cab5c501129c1d6c2321c1011cccb119515d75d07dc55c253b 6b5aa808025c0a4270cac540c07ba6faede1b3c70b8db5fd89ec5d46df9041b2 lib/codeql/rust/elements/internal/generated/FieldExpr.qll 3e506b5cb93793ec30f56bb637a600db869fcba6181b068516a671d55c362739 7bbf953696d763ad6b210f378f487ba85b875fa115b22c0c0508599a63633502 lib/codeql/rust/elements/internal/generated/FieldList.qll 43c13c6e3c9ba75a7a4cb870fc4f18752001584d48b9df0734055a6ebb789331 7c51b0b13eb02f1286d3365e53a976ba2655c4dbd8e735bc11c8b205c829e1ee -lib/codeql/rust/elements/internal/generated/FnPtrType.qll e8e2f159983fb0d9ccc30d62d0e8b679a06c066076eb8f4ca36f3bf12be406fe bc8f2efdf4645a63b9eafbec2f8e5d1008e1decb67f29bdf1eed4c3e2a89c64a +lib/codeql/rust/elements/internal/generated/FnPtrType.qll 748d766dbefd19a7d644734c57885eeede66897029bbfe1b87919517f43bfde2 5a7d80acc00e56594ed85026a8ea4923104d2e98c2e42db8c5bcd32ddd164e48 lib/codeql/rust/elements/internal/generated/ForExpr.qll 541b62b48911d4999f9ed64ab6c8b9910073ac4add0225761f319677328cf120 976c3a91c9eedfb1e2d9ea76ac501348643b3d23c723d7a777042258d416d091 lib/codeql/rust/elements/internal/generated/ForType.qll 3d43d044a1189281f09c55caafb6c8020a836f49e2866077086101925a573cf2 646b59bfd1b428aaf7211f574c49f79cb4c6a79ca151aa0663b2b31480298721 lib/codeql/rust/elements/internal/generated/FormatArgsArg.qll e07a1ae310f590003f1b88fada7dcf4847c99adb9d4c838d1c88e66e1da85c5f 0ef7342451fe2cb06e765fb4b33bb8c4a9b927f5edbc8feb5c6ba3655697f447 lib/codeql/rust/elements/internal/generated/FormatArgsExpr.qll 40d6daa7d2bafb33798a21d79774dc802cfbd7a31618ac3bd0149399ea2bf893 d1172e2151791228559004792e125fc4625f6a26ffad25f29efb0ad263bf8795 -lib/codeql/rust/elements/internal/generated/Function.qll b239af1a8874802b8a311706c53d56e3ceaad7ed23a7f97d1694bf961b63768b 4bc3c23685fa05820222e472ab1cdb40a271f862727d3bd878d47de9c2e3f485 +lib/codeql/rust/elements/internal/generated/Function.qll c8826307fcb18daf8c59552a5c629a0e59e83e7f676b4a30408a042ecc216a46 ae27a8a709c187ffd6fa7e25e7850555d1be6633d6ee304457a4481135402dcb lib/codeql/rust/elements/internal/generated/GenericArg.qll 464da0ba1c5ddcd1be68617167f177773d99b5ac4775ec8ea24d503e789a9099 6faa1033d59baf7c210ac4837a55781cfc054b7acbad8027faf4630dbfa6e101 lib/codeql/rust/elements/internal/generated/GenericArgList.qll b8cd936bba6f28344e28c98acf38acb8ef43af6ecf8367d79ed487e5b9da17cb 8b14331261e49d004807285b02fca190aafd62bfb9378b05c7d9c1e95525fe7b lib/codeql/rust/elements/internal/generated/GenericParam.qll a0285123f974f287154b706bf6688b86edf72a4adcec57346c654d962435651b b42c3915e9564b5b5c5282229bf882aa3309de26a77721b2255d6f4235c0cc38 lib/codeql/rust/elements/internal/generated/GenericParamList.qll f2d8945bc70cda6929bb6b652f9e3c7707e73fb5e778b21e99dbac594e71285f 7b97da5b6a6504377456bedebddc293d714f90e8fc2ce64199656666d5f749af -lib/codeql/rust/elements/internal/generated/IdentPat.qll 557b2b1fe9e719ac6658c06c162f03d5925d848d7fdc4364da850e588a3ca9df 5517fde679c47c0604a0d177c53bed64f83e33e14d1b64f45e3467e3a8be77fb +lib/codeql/rust/elements/internal/generated/IdentPat.qll a1269182132b2f52c5d842e58cbfa1cee49b143fa3766ed9fcf65389bf5137eb 46009fa66065222d865fa4714dd16c0373ffb16d576da45e7bf3a06432bd3a23 lib/codeql/rust/elements/internal/generated/IfExpr.qll 413dd7a20c6b98c0d2ad2e5b50981c14bf96c1a719ace3e341d78926219a5af7 c9a2d44e3baa6a265a29a683ca3c1683352457987c92f599c5771b4f3b4bafff -lib/codeql/rust/elements/internal/generated/Impl.qll 31fdd707dd8dcec845758b19eddcd4eb5bbd44ddccac83191cebe0c402834a66 ef06985099dee900a9403898f45349619ed138d23fee185137ed0baf679fe7cc +lib/codeql/rust/elements/internal/generated/Impl.qll e33ef5d3e49e64beca0ca9d5c0ba972d99007e5011eeedc11e67d3fbb569ab4a 5c5d88110864f4fd3d966b1ad973eaabd7a9c5a07adc18bff01dc09395214825 lib/codeql/rust/elements/internal/generated/ImplTraitType.qll 3c29684f5ef386b883b79dc9758441d97f090e065be177ffc8240aaf0f3d1e7b 03ea42c2a95cf917ec73d88b7b4ca5e53e10d7b046074f59100c0ec6c2c1ed6d lib/codeql/rust/elements/internal/generated/IndexExpr.qll cf951fc40f6690e966b4dc78fa9a6221aa5c6cade44759dcb52254f799292d11 1572e71918cc4e0b7e028331b6d98c9db23100a3646cd3874d1915e06ab6211d lib/codeql/rust/elements/internal/generated/InferType.qll 23ee25135c59ea5578cdf7c34a41f606e217e7260c3c8f404d12836585d5cad4 400da322fa1be62c4e300ebdf481eb92d4226eb6c316c668da8cc5168065774f @@ -527,8 +530,8 @@ lib/codeql/rust/elements/internal/generated/MatchArm.qll 8fb740a0f2e308782d9cf39 lib/codeql/rust/elements/internal/generated/MatchArmList.qll 13362680c037fe83fef4653562cc10a4429078316b5ec7c47b076336cf4aca2e 41c674293c13eceaca62134ae0c6778541f6a5201cbc5c146f0ba01b898dc267 lib/codeql/rust/elements/internal/generated/MatchExpr.qll 689d65f690fe05bc262d0a5bfe69bb4f8a142db387c5765fcc4958a9b49989f8 2979cd2017d0538870d17b2b7592c75cc05b706bd36c9de3e5dc38fa3a957e5b lib/codeql/rust/elements/internal/generated/MatchGuard.qll 521a507883963106780f1782084c581fbcf1179863c7c15438c4db79e30e78dd 6226feffaaa8d828a42ece0c693e616cd375672eb987c3b7ff1ca15fa23c116a -lib/codeql/rust/elements/internal/generated/Meta.qll f1ce7cdaf2a6fa3b86f0465e33a9521d254c032468427b276d93276ffd5142be 046d72c868ee2664b8a291de16320238ece9d0612c93c96a0d601e0b6079bf90 -lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll c2d6faf1f840628dbc5aa59c90dbd8b244f6bd4a7dba25e410047fcde11ff378 2d0251b095bf15b0275d493efdd1f9ce0926a3cff6671bb550a7a672aaf62a30 +lib/codeql/rust/elements/internal/generated/Meta.qll 38fca2c9958b4179de311546fe0850319010aca9cd17c97d57e12b521c5d0947 740f99c9d41044ceebfcc9d29baaa22f59c11a40f45502a34aa587d423c018f8 +lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll 0966b268c9d71a8007044d608935e0c07d2144eaafef4812ef259d68b00a06f4 b3a5ab7ec79a6cfa55f671288b8c7c946883fd2edc0b3fac68221ab742cf8604 lib/codeql/rust/elements/internal/generated/Missing.qll 16735d91df04a4e1ae52fae25db5f59a044e540755734bbab46b5fbb0fe6b0bd 28ca4e49fb7e6b4734be2f2f69e7c224c570344cc160ef80c5a5cd413e750dad lib/codeql/rust/elements/internal/generated/Module.qll ebae5d8963c9fd569c0fbad1d7770abd3fd2479437f236cbce0505ba9f9af52c fa3c382115fed18a26f1a755d8749a201b9489f82c09448a88fb8e9e1435fe5f lib/codeql/rust/elements/internal/generated/Name.qll 12aad57744b7d1b04454159536409244c47319aedd580acb58ee93ef9d7f837d 63fc67ccc085db22f82576a53489f15216a7c29d5b941b14a965eab481534e2e @@ -541,7 +544,7 @@ lib/codeql/rust/elements/internal/generated/ParamList.qll c808c9d84dd7800573832b lib/codeql/rust/elements/internal/generated/ParenExpr.qll bc0731505bfe88516205ec360582a4222d2681d11342c93e15258590ddee82f2 d4bd6e0c80cf1d63746c88d4bcb3a01d4c75732e5da09e3ebd9437ced227fb60 lib/codeql/rust/elements/internal/generated/ParenPat.qll ce24b8f8ecbf0f204af200317405724063887257460c80cf250c39b2fdf37185 e7c87d37e1a0ca7ea03840017e1aa9ddb7f927f1f3b6396c0305b46aeee33db6 lib/codeql/rust/elements/internal/generated/ParenType.qll 9cc954d73f8330dcac7b475f97748b63af5c8766dee9d2f2872c0a7e4c903537 c07534c8a9c683c4a9b11d490095647e420de0a0bfc23273eaf6f31b00244273 -lib/codeql/rust/elements/internal/generated/ParentChild.qll 8df70abc5ebf6bd1439976404a002b457a006ca677645c970f7e8a23c31b2884 887cf53d918c0825f60b7e7824eefb61f3b7d48a15d73116c42bb67b362cd376 +lib/codeql/rust/elements/internal/generated/ParentChild.qll 99038e13a29e95611c11d77d7096577a6169fe806770dfdb9c39c17737e0a13c ad81306bd95d82724aedd186bb47c03910107bec509ef86fe55d07fb85baf6c7 lib/codeql/rust/elements/internal/generated/Pat.qll 3605ac062be2f294ee73336e9669027b8b655f4ad55660e1eab35266275154ee 7f9400db2884d336dd1d21df2a8093759c2a110be9bf6482ce8e80ae0fd74ed4 lib/codeql/rust/elements/internal/generated/Path.qll 299abce24762a5ab023f3cf1ab9718b83047e171aed42a8092e7a155914b1657 db1a23d18640c548f08c9f94823838b5e019ac85877c7b15df2d1493d1846572 lib/codeql/rust/elements/internal/generated/PathExpr.qll 17cdb0a7393258a207450f08e37178fc9d35d167f064ba6015be94246f3dc933 a75fdd280aff6d87e083a92030e041c2eb52b57cf7151d4a6989fcd31d6a64bf @@ -549,11 +552,11 @@ lib/codeql/rust/elements/internal/generated/PathPat.qll 98c9938d6a359fd717829b19 lib/codeql/rust/elements/internal/generated/PathSegment.qll 4621597fd86246f788b8f9ca73f6b0f27929fc04261ce3ccf85da1183071431d aadda8bce386a3b7a9c53b98465eedcc4f724e37b8a904c1775af5b7ffb041ee lib/codeql/rust/elements/internal/generated/PathType.qll 45de78e5374d6eb0446e2112ec72d3692c2811df9fa2ad03d0127e426940abe3 622cf70408413a565a0dac58f451035ac1339c8d0ee5b24f630680201cb0aa48 lib/codeql/rust/elements/internal/generated/PrefixExpr.qll c9ede5f2deb7b41bc8240969e8554f645057018fe96e7e9ad9c2924c8b14722b 5ae2e3c3dc8fa73e7026ef6534185afa6b0b5051804435d8b741dd3640c864e1 -lib/codeql/rust/elements/internal/generated/PtrType.qll 5f12b6ad29b4e5ce51c205e2199594ce190e1aa24fbe3ddcfd82317a0b472222 8940e8dcccdf5cfc863aa2f2bc52bbddfa4d9ac8e8b38973cc1ecc1fbe32b3d4 +lib/codeql/rust/elements/internal/generated/PtrType.qll 40099c5a4041314b66932dfd777c9e2bef90a0711fb8d7c2c2cec764c003ac4a cf8297d93557356a572223d3e8acca701837c4b1f54e8d4351ba195fb7ed27f8 lib/codeql/rust/elements/internal/generated/PureSynthConstructors.qll dc03515d678ba052c2ff2dd9f0883e0bce54cac740ba9a15e5173f292c1b6971 dc03515d678ba052c2ff2dd9f0883e0bce54cac740ba9a15e5173f292c1b6971 lib/codeql/rust/elements/internal/generated/RangeExpr.qll 23cca03bf43535f33b22a38894f70d669787be4e4f5b8fe5c8f7b964d30e9027 18624cef6c6b679eeace2a98737e472432e0ead354cca02192b4d45330f047c9 lib/codeql/rust/elements/internal/generated/RangePat.qll efd93730de217cf50dcba5875595263a5eadf9f7e4e1272401342a094d158614 229b251b3d118932e31e78ac4dfb75f48b766f240f20d436062785606d44467b -lib/codeql/rust/elements/internal/generated/Raw.qll 2584a84e50134d9f936e15a6a02e6d9db12d10115530f006fe322e9aad001473 c7cce257bbc41aa45d1275abd95c4cb9ee42335e934356f8666429afb34e0111 +lib/codeql/rust/elements/internal/generated/Raw.qll dcdd499e48ca8cc43354717791dec6341f744c38a133bb6a35ed44db3a2f16e2 1b9493df5e91be496d6f20ae0d9da5c49268377f7cc31f94bf171a8c387752d4 lib/codeql/rust/elements/internal/generated/RecordExpr.qll eb6cb662e463f9260efae1a6ce874fa781172063b916ef1963f861e9942d308d 1a21cbccc8f3799ff13281e822818ebfb21d81591720a427cac3625512cb9d40 lib/codeql/rust/elements/internal/generated/RecordExprField.qll 7e9f8663d3b74ebbc9603b10c9912f082febba6bd73d344b100bbd3edf837802 fbe6b578e7fd5d5a6f21bbb8c388957ab7210a6a249ec71510a50fb35b319ea1 lib/codeql/rust/elements/internal/generated/RecordExprFieldList.qll 179a97211fe7aa6265085d4d54115cdbc0e1cd7c9b2135591e8f36d6432f13d3 dd44bbbc1e83a1ed3a587afb729d7debf7aeb7b63245de181726af13090e50c0 @@ -562,27 +565,27 @@ lib/codeql/rust/elements/internal/generated/RecordFieldList.qll d7bb2677338cf420 lib/codeql/rust/elements/internal/generated/RecordPat.qll f5f9904fcd8b8fa5fe65b46a68f830021a5e4a68f95ff403151565c3ec770477 56294ed2ff753d8be7742a501b15b5f3f5f20afe0f8171ee6771d049f26489e4 lib/codeql/rust/elements/internal/generated/RecordPatField.qll f17b1aa265091fd8309fd90d5c3822d170870e304f160225327de5a844a9aed4 0458e39dbe88060b4b664692cf0b41ebf4364de268d9417658c14c883c9c1b33 lib/codeql/rust/elements/internal/generated/RecordPatFieldList.qll 08d4740bbb519f15ab20b694b3c45e396a2a59cce0f68fa4b9698348784cae43 99919809607ae61c707f591ee609c50bcfb90d5b4f9c263f6b8e78658d21b605 -lib/codeql/rust/elements/internal/generated/RefExpr.qll f75a9550456e8b53044d0aa94b69148cb04950273000ac19eda57a836091670e 24ea42dc26b6b84f5807959e787a0487b7a33ed1f20c24d34af2799110a1902b -lib/codeql/rust/elements/internal/generated/RefPat.qll 7483fcf9bf555a0ca60bfdbb91fd1c7344c98cb60506469cab24fddd90450005 b233f86eec76a3916ca5daac4812083f452f26089cabc13811a5600862ac1832 -lib/codeql/rust/elements/internal/generated/RefType.qll 90b03447b77c9a8ae5317a7f605beac4a3c9251f2e5409681fe8badad41d1dd7 bd96341b52450eb0ab262aa8ffd810ff7b091d4c1ed8576d794d7705af565296 +lib/codeql/rust/elements/internal/generated/RefExpr.qll 7d995884e3dc1c25fc719f5d7253179344d63650e217e9ff6530285fe7a57f64 f2c3c12551deea4964b66553fb9b6423ee16fec53bd63db4796191aa60dc6c66 +lib/codeql/rust/elements/internal/generated/RefPat.qll 5c4d908f851d89f42cf765007c46ac4199200f9b997f368d5b0e2a435efa82cd 42fd637bc98b5a9275386f1c5fb3ae8c4681987289a89b060991416a25131306 +lib/codeql/rust/elements/internal/generated/RefType.qll 3603a3e000acc25c5e675bd4bc4a5551b8f63851591e1e9247709e48d1769dc5 91bea4a1d5ef0779d575567253cd007157d3982524e63a7c49c5cae85cb42e5f lib/codeql/rust/elements/internal/generated/Rename.qll d23f999dab4863f9412e142756f956d79867a3579bd077c56993bdde0a5ac2f1 9256c487d3614bf3d22faa294314f490cf312ab526b8de0882e3a4a371434931 lib/codeql/rust/elements/internal/generated/RestPat.qll b3a4206e68cf67a0310a466721e7c4b3ab855e65490d589d3d856ad333b3d5e8 30b471bec377784f61d73ef93e74fc0dcec7f512ac4b8791d1ca65f2bcea14b8 lib/codeql/rust/elements/internal/generated/RetType.qll a26860cd526b339b9527c089d126c5486e678dd080e88c60ea2fe641e7d661fd a83c1ce32fd043945ad455b892a60c2a9b6a62d7a5aadf121c4b4056d1dfb094 lib/codeql/rust/elements/internal/generated/ReturnExpr.qll c9c05400d326cd8e0da11c3bfa524daa08b2579ecaee80e468076e5dd7911d56 e7694926727220f46a7617b6ca336767450e359c6fa3782e82b1e21d85d37268 lib/codeql/rust/elements/internal/generated/ReturnTypeSyntax.qll 34e32623d2c0e848c57ce1892c16f4bc81ccca7df22dc21dad5eb48969224465 ccb07c205468bce06392ff4a150136c0d8ebacfb15d1d96dd599ab020b353f47 -lib/codeql/rust/elements/internal/generated/SelfParam.qll cc9693cd6efd7528584f00696b86e41027e05066f8e8aba1ca25bd7567b971ed 689b4746ab4e82de0b7b6e11350959c5194a1562497a21a831c75c6e325ff468 +lib/codeql/rust/elements/internal/generated/SelfParam.qll cf6837c2731b45632f04092079d295eee3e02d19f73c73b3ccbce1abe12203bf 87eaa9d982506904c42030f7173dd01fd52f3edd9d2c8d19b572f6d5454f769b lib/codeql/rust/elements/internal/generated/SlicePat.qll 8b1463758d7b15a0303384c8136a48a8e71ce27da4ba6e421272b9751a988e64 7562d47308f197bc63ade0f114cd23a17e7f60fa696716f6a30fc7b7411642fe lib/codeql/rust/elements/internal/generated/SliceType.qll 98ee8b566be28f392ab9c9507600e8461ad0b48cbbbd422d22548aca691f8330 528d6eabddf49b9dc474971a2f3a6ddb6f2d77dc7f8449140ef54646c1ceb822 lib/codeql/rust/elements/internal/generated/SourceFile.qll 55d44c9f09c5ff28c4f715f779a0db74083e1180acaf0d410e63ca07b90d1cb5 78c0af48b0b64aa377413ea4799dfe977602a111208e1d25e4bdfa920dbd7238 -lib/codeql/rust/elements/internal/generated/Static.qll cae5313e08e4af44c46b2580226993eff639a5257863276e720de2309afff3c3 93fdbd117ecb69fbef5c84632e08483c0faf051f882f1a266215044a0d5bfd94 +lib/codeql/rust/elements/internal/generated/Static.qll 5fbd6879858cf356d4bdaa6da475de729c12d44ee99aef12bdefe657fdb885e0 0c8e9ef7a93c59b9346265338e38ae3f2e1265981f2d81aab49bc36cf0589382 lib/codeql/rust/elements/internal/generated/Stmt.qll 8473ff532dd5cc9d7decaddcd174b94d610f6ca0aec8e473cc051dad9f3db917 6ef7d2b5237c2dbdcacbf7d8b39109d4dc100229f2b28b5c9e3e4fbf673ba72b lib/codeql/rust/elements/internal/generated/StmtList.qll a667193e32341e17400867c6e359878c4e645ef9f5f4d97676afc0283a33a026 a320ed678ee359302e2fc1b70a9476705cd616fcfa44a499d32f0c7715627f73 lib/codeql/rust/elements/internal/generated/Struct.qll 4d57f0db12dc7ad3e31e750a24172ef1505406b4dab16386af0674bd18bf8f4b 1a73c83df926b996f629316f74c61ea775be04532ab61b56af904223354f033e -lib/codeql/rust/elements/internal/generated/Synth.qll 2ab340e385c8c759132040f8317480e29b881fc06652d9ac79d3a6c7ba226e43 a302504aff25f9c8da4aa6a0d83eb7daa7a18496cf71654be925dda460c28b61 +lib/codeql/rust/elements/internal/generated/Synth.qll f02ed28dc96e2fd273109ee0564b6c6087b78d43d2a2a38bc4aeb25af79874cd f17c0118aadaf55f10036ace989ec5c925b1a2b8cfc2cbb63176751b26ff2636 lib/codeql/rust/elements/internal/generated/SynthConstructors.qll 5d30b6d4f36791637f250734ee38820102c64f196454e20f79e30097da1a8e20 5d30b6d4f36791637f250734ee38820102c64f196454e20f79e30097da1a8e20 lib/codeql/rust/elements/internal/generated/Token.qll 77a91a25ca5669703cf3a4353b591cef4d72caa6b0b9db07bb9e005d69c848d1 2fdffc4882ed3a6ca9ac6d1fb5f1ac5a471ca703e2ffdc642885fa558d6e373b lib/codeql/rust/elements/internal/generated/TokenTree.qll 8577c2b097c1be2f0f7daa5acfcf146f78674a424d99563e08a84dd3e6d91b46 d2f30764e84dbfc0a6a5d3d8a5f935cd432413688cb32da9c94e420fbc10665c -lib/codeql/rust/elements/internal/generated/Trait.qll 32bdbb4dc9f03488195a90320a947013135cd2fae1b9d62b4f71ed9a4e39a967 5dab0fbec64698bf3cdae04879d3d1665cf82386b7b030ed69e6b20776ffa9fc +lib/codeql/rust/elements/internal/generated/Trait.qll a570fa93d0b78a35766b00d5ca256c102f824564248b9d8b678a981d6eea3e2e d9c7475e5102e21cfdee3b1791f89a4f9cdba5a4200349ff706532b704c02664 lib/codeql/rust/elements/internal/generated/TraitAlias.qll 0a3b568100baaca129a12140b0742a1c8e507ef5b2f2c191ff7452c882ba4064 c32e74569f885c683f8d3977682fcbc8b7699b00d5e538cc6b08acdfffa56bc8 lib/codeql/rust/elements/internal/generated/TryExpr.qll 75bf9fdda5238155d2268806d415e341fa57f293dcadef003b4a11562c4cd877 935c746f822cf183cdf36bef2332f01e7ce38aa09aa8476d64c1062c5e8f13dd lib/codeql/rust/elements/internal/generated/TupleExpr.qll 75186da7c077287b9a86fc9194221ab565d458c08a5f80b763e73be5b646b29f 0250d75c43e2e6f56cdc8a0c00cc42b3d459ea8d48172d236c8cdf0fe96dfed2 @@ -591,9 +594,9 @@ lib/codeql/rust/elements/internal/generated/TupleFieldList.qll 9d4981d04c2ee005e lib/codeql/rust/elements/internal/generated/TuplePat.qll d61163a380f3f2c1709080e2df69a90764509af060e607e27e832862e4dae18c 108b7db493a21fe1fa0db99fceee952aabb0a128eac41e050877ab9136407403 lib/codeql/rust/elements/internal/generated/TupleStructPat.qll 87e0acfeb51d48c55648d5af783f5ea006aaeccce990ba26458c6935fbdf7c11 7c761e66ddacb51307e653c6ad45bec3fba8315049fbe6c4503ed19241204d41 lib/codeql/rust/elements/internal/generated/TupleType.qll 7fae8e881157a24c4ce4f960269ba8010e227a81d3055b571f861f7196f868e2 18085a19a102df8e2cded938b49709225e89f0ce68b4a003310647bb259a6bd3 -lib/codeql/rust/elements/internal/generated/TypeAlias.qll c584cd4c6fedc50818e7bd6a3ac8d14ba916e7ae6be179bd2f51f3aff95673ab f4be9e83c9814fec205c606de5afeec836a7ec8d58d8b64fec9126472f2a8c68 +lib/codeql/rust/elements/internal/generated/TypeAlias.qll af02bb172b6f2d7f5eab8645a5a219eee8a4bbc445838f5739f18ba217c7e608 6d871471d673adae99c8b146f6f7ab204f24d52b5013b4582037a42b279c9f05 lib/codeql/rust/elements/internal/generated/TypeArg.qll fe4441b3faa44e542c43a85353347df23d3f74da0c4b17cb0fdc60f5aca9dee7 1473d044e979e7cb6628525ffd454549cd8a37560488c695f534243946cf83bc -lib/codeql/rust/elements/internal/generated/TypeBound.qll c6f75fd8e99e575c33d424c2c9c85918554bdb87b5f78848c66538df6ad08559 f107ae5edadc3bd1b2e76f0c5ab15d043946ac9d2db62c10132690de7282003c +lib/codeql/rust/elements/internal/generated/TypeBound.qll c4e5a5a919a30f4b334e8218b69fae887bf43e3b87bc63863b2c891beba14ba0 c9d394f31a7cbcfae95d511ad030ed515f51e87697233643b9ac12d6ac61ab18 lib/codeql/rust/elements/internal/generated/TypeBoundList.qll 31881cae2f71df5adf7a427357565bc0e7ba58c6a774a9d5835560a34c4db30f 1ff36ba34dd966d945d743781e3a1cccad4bb9fd5d32902dfd0bcad537501a85 lib/codeql/rust/elements/internal/generated/TypeParam.qll dd57c5c370b4e3ed87c42c4fccf71b554cf1c588de1a1d1ac4ed5edbc1fb4664 09cd09537c1196f0a84850f654d324c6ad8aeaf9debcc3d9879e23a313ed93d9 lib/codeql/rust/elements/internal/generated/TypeRef.qll c4c3bdafe3deb05338f5031c798fa6e72b58301ee7737a785314e72c9c4f091c e6ec0c680bcfe61ff79468de485241a75fbd795b2d501004324b66b003fddbce @@ -613,7 +616,7 @@ lib/codeql/rust/elements/internal/generated/WhileExpr.qll fec8a9211b82a80601bf73 lib/codeql/rust/elements/internal/generated/WildcardPat.qll d74b70b57a0a66bfae017a329352a5b27a6b9e73dd5521d627f680e810c6c59e 4b913b548ba27ff3c82fcd32cf996ff329cb57d176d3bebd0fcef394486ea499 lib/codeql/rust/elements/internal/generated/YeetExpr.qll cac328200872a35337b4bcb15c851afb4743f82c080f9738d295571eb01d7392 94af734eea08129b587fed849b643e7572800e8330c0b57d727d41abda47930b lib/codeql/rust/elements/internal/generated/YieldExpr.qll 37e5f0c1e373a22bbc53d8b7f2c0e1f476e5be5080b8437c5e964f4e83fad79a 4a9a68643401637bf48e5c2b2f74a6bf0ddcb4ff76f6bffb61d436b685621e85 -lib/codeql/rust/elements.qll c4c6906be828eb2fa9cc5dcaf4df197a45c8e1c606f8665ca9e58c24715fd077 c4c6906be828eb2fa9cc5dcaf4df197a45c8e1c606f8665ca9e58c24715fd077 +lib/codeql/rust/elements.qll 28718424faf8e099bffc4f408409a9790f58ec0ce5618574a99a3f1118a3002e 28718424faf8e099bffc4f408409a9790f58ec0ce5618574a99a3f1118a3002e test/extractor-tests/generated/Abi/Abi.ql 7f6e7dc4af86eca3ebdc79b10373988cd0871bd78b51997d3cffd969105e5fdd 2f936b6ca005c6157c755121584410c03e4a3949c23bee302fbe05ee10ce118f test/extractor-tests/generated/Abi/Abi_getAbiString.ql a496762fcec5a0887b87023bbf93e9b650f02e20113e25c44d6e4281ae8f5335 14109c7ce11ba25e3cd6e7f1b3fcb4cb00622f2a4eac91bfe43145c5f366bc52 test/extractor-tests/generated/ArgList/ArgList.ql e412927756e72165d0e7c5c9bd3fca89d08197bbf760db8fb7683c64bb2229bc 043dba8506946fbb87753e22c387987d7eded6ddb963aa067f9e60ef9024d684 @@ -652,7 +655,7 @@ test/extractor-tests/generated/BinaryExpr/BinaryExpr_getAttr.ql 26d985ac4b668d78 test/extractor-tests/generated/BinaryExpr/BinaryExpr_getLhs.ql c3f19d8a60066ad6b1810291a669473c75b659cd2f6ac3ab9ed3db2203d4145c c05c5e0226e30f923155669ffc79cfe63af1ca464e8dfc85888dda5f7049711b test/extractor-tests/generated/BinaryExpr/BinaryExpr_getOperatorName.ql 33612159be1c111e3306009d0b04579450fc962a81119b6ea4e255d3c409b401 1a0995b298f50242217cfef81dca8ac978e19e06f90a5f4caadcb6f84460fec2 test/extractor-tests/generated/BinaryExpr/BinaryExpr_getRhs.ql 3bcd36b678e87d5c29a43b69c54c80468a89aefa7e69481b48158ae794a53160 a629dc1472b3f6fd7c608ff760e83d8e1363db81dfe9a4b2968690c2ba4925ca -test/extractor-tests/generated/BlockExpr/BlockExpr.ql 45aba7a94638c343b05560309ecf11e436b1265565072f1cba138bac804e57f2 6d556c1d1f6ac58dc93e542930940f127a7f69181e39275afdc6852d90f12a23 +test/extractor-tests/generated/BlockExpr/BlockExpr.ql 0ab66b190d4e2aa784e61088c4779ef4d08cb4453677ea087c4f9aa369494bc2 1c3b5794008114d1297695d82590220929e3974e27836b2c6062d14b73379a40 test/extractor-tests/generated/BlockExpr/BlockExpr_getAttr.ql 15d4d9853d3262ce6ec629c075c60a76eb112dcafe34b71df0e09b39282223cf 792c498bc7079bb5b93034b8a87db3b275a591d78954e844821aeacffe4258ea test/extractor-tests/generated/BlockExpr/BlockExpr_getLabel.ql de3c28a2677ed71ebd95207aa43ce270765f7f556283f095f1f6296622b80cbc 414ebbb2bfbe4350f933fc3d3636b49a6bb8242e200180780caf95ab8523adb0 test/extractor-tests/generated/BlockExpr/BlockExpr_getStmtList.ql 8c391dfeb69bd92c547a2417bf231cc960a8f34845802722214294728772316a f3e847fa594e9d9cf25d09a0396a10176aad1100c1977a24756ff6287a79e69e @@ -672,14 +675,14 @@ test/extractor-tests/generated/CastExpr/CastExpr_getExpr.ql c37186b8f3e3dab8ae28 test/extractor-tests/generated/CastExpr/CastExpr_getTy.ql ad5d6e260e1495ba360bd2ade3b60f09705a86a08d618acf8c4aff342c8ee200 c02c1dc65ba9160bc28827e40473915de5403bdc91c16d9d8b6778aa97314a1b test/extractor-tests/generated/ClosureBinder/ClosureBinder.ql 42516df87ac28c814d65f6739b2ede6eaa41c505d64756a3b8c7e0ca79895230 8b840f92ec033a4ef5edbe52bed909d8be0fffddf6d3e4bfaf9a8bc174fa2f2c test/extractor-tests/generated/ClosureBinder/ClosureBinder_getGenericParamList.ql 71010c43a78a7abe8e63c94353f4b7eb97aca011755d200e7087467c1e3b7a68 2c834328f783ec5032544a692f7e23975bac0228b52b9f8fde46ef46a5f22a5f -test/extractor-tests/generated/ClosureExpr/ClosureExpr.ql d79b1a60e9cd4266f756872f44363d062e8030baae9eb4b1dbaf9465ae88f0ec 46414e0aa4330a42f67083bf866a360fb5e2b234b7df5564559285046311e8e1 +test/extractor-tests/generated/ClosureExpr/ClosureExpr.ql 430d566d8176d7b98d6cde6c35f9420249236eddb084f9c7cbb091cc683ff063 6b8127425cad540a1e407ff7b387f3924253da980f46e5a678aeb2870ba6ec7b test/extractor-tests/generated/ClosureExpr/ClosureExpr_getAttr.ql f7f803afa4e2a5976c911fdf8a91ec607c2f998e22531b9c69a63d85579e34c3 1296acd0fb97e1484aa3f1d5ba09d18088001186f3ba5821eb3218a931ca0d54 test/extractor-tests/generated/ClosureExpr/ClosureExpr_getBody.ql 22a973a61274e87620e38338b29beef395818b95a88e2261fff197f7a78a8f76 bd28ed426e4d07823044db869aa8022dc81e8599d156e3e0e7cd49be914a1f36 test/extractor-tests/generated/ClosureExpr/ClosureExpr_getClosureBinder.ql cbfcf89b8efb5cb9b7bfbea26b5a78b3d4c7994cbf03d5ca60b61ee1b5cb4be5 621431277732ef79c585cb0b7199c49b14c597ee6b594a70d9e6966a09d40a9f test/extractor-tests/generated/ClosureExpr/ClosureExpr_getParamList.ql 68ce501516094512dd5bfed42a785474583a91312f704087cba801b02ba7b834 eacbf89d63159e7decfd84c2a1dc5c067dfce56a8157fbb52bc133e9702d266d test/extractor-tests/generated/ClosureExpr/ClosureExpr_getRetType.ql c95bc7306b2d77aa05a6501b6321e6f1e7a48b7ad422ba082635ab20014288ae fe72d44c9819b42fff49b9092a9fb2bfafde6d3b9e4967547fb5298822f30bc3 test/extractor-tests/generated/Comment/Comment.ql 5428b8417a737f88f0d55d87de45c4693d81f03686f03da11dc5369e163d977b 8948c1860cde198d49cff7c74741f554a9e89f8af97bb94de80f3c62e1e29244 -test/extractor-tests/generated/Const/Const.ql db81591df5a8822a578f9445b8444f6ac391efc43c61aab429edb76ab9c0303d 5f7ae3622c03eb151fa5326db785f0ff3fe6f52033fc071d758eac18ea1b5722 +test/extractor-tests/generated/Const/Const.ql d02d4010c54f2cfcb9251f362c3768740399807eb4fe995373d9a316f14e7a8b 8d277779d3d3ded5cf0829dc9bfd8936f2334d89de4a84e110f0a017224729a5 test/extractor-tests/generated/Const/Const_getAttr.ql bd6296dab00065db39663db8d09fe62146838875206ff9d8595d06d6439f5043 34cb55ca6d1f44e27d82a8b624f16f9408bae2485c85da94cc76327eed168577 test/extractor-tests/generated/Const/Const_getBody.ql f50f79b7f42bb1043b79ec96f999fa4740c8014e6969a25812d5d023d7a5a5d8 90e5060ba9757f1021429ed4ec4913bc78747f3fc415456ef7e7fc284b8a0026 test/extractor-tests/generated/Const/Const_getName.ql b876a1964bbb857fbe8852fb05f589fba947a494f343e8c96a1171e791aa2b5e 83655b1fbc67a4a1704439726c1138bb6784553e35b6ac16250b807e6cd0f40c @@ -687,9 +690,9 @@ test/extractor-tests/generated/Const/Const_getTy.ql bf9abfd2be9d22193bc6be9916c7 test/extractor-tests/generated/Const/Const_getVisibility.ql de6b2e9d887316e279b45fab7887980ca7d93fd32c2259f3a06de2b6e2957c12 2f135cdbbb84b43d282131edb7eb4df6caba61bf7421881a49d4679f0f44f661 test/extractor-tests/generated/ConstArg/ConstArg.ql f1422b216eb45819ff41f0c19e0f88aa184ddd3fa2984ba22ec46df398147fc3 d2e4f367848c2bc4f6aef51c1dd8180035c39919430082c83f18a3f324228df3 test/extractor-tests/generated/ConstArg/ConstArg_getExpr.ql 317fd83ad51acc3ff3dfab71ebb1385b67d49404c1d7b3804a8ca3c099b84e99 91ecf5ebbfc1aab286dce708680f0be97417f9755676db7479fa6836e50be845 -test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.ql b3e1f8c54af03af3cfe16dcf1831777404e360058f67acc4453c0d4211897d12 6f842cf96153219c7ab0d7d04db9a52b8fec71996d527bce69acb6678e437861 +test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.ql ee17b4deba9c503130e3ce565102bc8e181770efcb1309be9c822f0a7ba6fc17 638ed17b5c009e71b31f580c4060ba763bd4208c3984b6c032183ab46a4dd43d test/extractor-tests/generated/ConstBlockPat/ConstBlockPat_getBlockExpr.ql cc06e762e1652e467c7cf02c34f17c621fb3a938f294ee527fa04ed78c8701ec f863f8f6bfc9d169b585ae56b4e4ac0fc1603fd14775450e950cca4d5ea28e8a -test/extractor-tests/generated/ConstParam/ConstParam.ql f883b198f9c373e2d4c630706af5ba1d8a2f8f4e9847e9a54ca56cc892dbdc34 ad59caac567e80940c7e0f06239a91e7793a57e9e6ab0452535daa1aae3f2a1e +test/extractor-tests/generated/ConstParam/ConstParam.ql 1c2ec1a00ffc754ade227536f3efe789cdbee714fa003abff5e0221b9b53d08a 6f24ef0b280b18603a6efd217c691c4249898be95dafd5ff5a586cb2f2ecdf40 test/extractor-tests/generated/ConstParam/ConstParam_getAttr.ql af8949f1ea039a562a3b3561185a85f7f8a871bf27dba0580782f81c62b6508c 2874783b84fdce47b809f953e02c36473cad6a2d3dd1c0f1a9cb14a3e28b9c30 test/extractor-tests/generated/ConstParam/ConstParam_getDefaultVal.ql 021630468422c30e7aa623bdf4e97f3076e68087991723c624922b1ee608d173 9fd78738cfd0455be2c655852f6c618e901af80c6b6791396d9683c118a44e91 test/extractor-tests/generated/ConstParam/ConstParam_getName.ql e2e9b75dd7ce501793efce75079aabd3851b91aa4d437972693bacd7b04859d8 4d2326b39af870a2ef8b37448f78395cdb5c1e94df88f137ef71f8fd3548cd8e @@ -708,7 +711,7 @@ test/extractor-tests/generated/Enum/Enum_getVisibility.ql 7fdae1b147d3d2ed41e055 test/extractor-tests/generated/Enum/Enum_getWhereClause.ql 00be944242a2056cd760a59a04d7a4f95910c122fe8ea6eca3efe44be1386b0c 70107b11fb72ed722afa9464acc4a90916822410d6b8bf3b670f6388a193d27d test/extractor-tests/generated/ExprStmt/ExprStmt.ql 811d3c75a93d081002ecf03f4e299c248f708e3c2708fca9e17b36708da620e5 a4477e67931ba90fd948a7ef778b18b50c8492bae32689356899e7104a6d6794 test/extractor-tests/generated/ExprStmt/ExprStmt_getExpr.ql e269bb222317afe1470eee1be822d305fc37c65bca2999da8d24a86fa9337036 088369d6c5b072192290c34c1828b1068aeedaabdae131594ca529bbb1630548 -test/extractor-tests/generated/ExternBlock/ExternBlock.ql d28af9f7d0fa29687fb3f420401769612ea5ed320597bddf6653a108ede53049 b4deea6cb1ebda9db6968096e4048f5eeca41261b2c2c30d5d23971301bd2cb0 +test/extractor-tests/generated/ExternBlock/ExternBlock.ql 0c50adb4ce7479100fe46e097801df699911b4888a4919aa7ca337e2ef8a2525 101eee87add6793006bac20a2f7d0e245a1c04cbc81834b6130db083578b0c5f test/extractor-tests/generated/ExternBlock/ExternBlock_getAbi.ql 9b7c7263fcbc84e07361f5b419026a525f781836ede051412b22fb4ddb5d0c6a c3755faa7ffb69ad7d3b4c5d6c7b4d378beca2fa349ea072e3bef4401e18ec99 test/extractor-tests/generated/ExternBlock/ExternBlock_getAttr.ql 78ed6a2d31ccab67b02da4792e9d2c7c7084a9f20eb065d83f64cd1c0a603d1b e548d4fa8a3dc1ca4b7d7b893897537237a01242c187ac738493b9f5c4700521 test/extractor-tests/generated/ExternBlock/ExternBlock_getExternItemList.ql 2c2b29bdfdc3b27173c068cbaab9946b42053aa14cf371236b4b60ff2e723370 dfc20fc8ef81cdce6f0badd664ef3914d6d49082eb942b1da3f45239b4351e2f @@ -724,7 +727,7 @@ test/extractor-tests/generated/FieldExpr/FieldExpr.ql 1b45da610feb62cee42f7a3866 test/extractor-tests/generated/FieldExpr/FieldExpr_getAttr.ql 609c4f1e275d963cf93a364b5ec750de8cb4790abdaa710cb533ff13ab750a4e 8c2aa84b1ea6ef40a7ee39a2168baf1b88323bfbc6b9f184e7b39631765a48dd test/extractor-tests/generated/FieldExpr/FieldExpr_getExpr.ql 57df2d733faf3e3e30ae106d8423aab612ab0ddf8659da008e384130cf1e8023 1e240bee8e83dc26f78d2c55464ca1fb88d773691d47aee9a2182c90f57eb8f1 test/extractor-tests/generated/FieldExpr/FieldExpr_getNameRef.ql 8631f5e8bdd72443a1ee3d667ee9136a51ad49dfd206612a36b79686da1beb19 692aef607108b8e3eaa78b8c915f2fd1d310905f8fea770b9694722a9a2a6232 -test/extractor-tests/generated/FnPtrType/FnPtrType.ql c8fe0b3c849e37ac2bfbb1658ea3b0081502ed6fffb65454853298ffb2383966 d6732c9fa4e37f42c34369a67147df1a1fd453fdc1aa982c3f59578fd1f3f818 +test/extractor-tests/generated/FnPtrType/FnPtrType.ql 50b76d678582cd0b8d7cc4a7658d5009d660bafcec6bd9968c9f60a7f547fa23 5bbf2504eb835e231a2355bc5d099322423c49c6af371902cf20a150e360cea7 test/extractor-tests/generated/FnPtrType/FnPtrType_getAbi.ql de1706382c2980c02dbdd295e0a2320c992afa3f19af0c2378b9980a7cd0c481 a3fa36711949d9d5ac53cc5dd39cb19b397c3f2e47c1d457df470c6e5142f9be test/extractor-tests/generated/FnPtrType/FnPtrType_getParamList.ql 9ea393acf37919e2fd1bbc16e738440e00a56552bf80baef9bfd2a9a405afb93 3b4237b22eea569cef0081eb3ea16b2d0f01f8f070f21e16390267e9cbe0cf57 test/extractor-tests/generated/FnPtrType/FnPtrType_getRetType.ql 57f662e4778e1bf4103f061bb8085def0708528f94045c9ff4a95ce802fff13d 924b924c7d766458e956afa0963e6eb1bfc083e5f9aeae64cf2d08929f79612c @@ -744,7 +747,7 @@ test/extractor-tests/generated/FormatArgsExpr/FormatArgsExpr.ql 0cd439f61569ecf0 test/extractor-tests/generated/FormatArgsExpr/FormatArgsExpr_getArg.ql 8f692486be1546b914b17abdff4a989dfbaa889bfa1fc44597f4357806c1a1dd da9fd237e31e9c8dd0ef0c3c968157815b87d3e8dcdfd74674c988ce2ab6d270 test/extractor-tests/generated/FormatArgsExpr/FormatArgsExpr_getAttr.ql 1f9bf1344f942e65c3a3591b6ae04d3f5a2a1a65459bce0d976698de7d8a5958 02acb861d8ab4d32cf144c589881a888c3da5e2ade27e8c85fec3ae45219bb3b test/extractor-tests/generated/FormatArgsExpr/FormatArgsExpr_getTemplate.ql c912ac37275cbe7b3b29607bed1a3190c80779436422c14a475113e1bfd91a54 ef90f67a9b952a38ce557b1afbf0b5ce8551e83ddfaad8309a0c9523e40b5ea7 -test/extractor-tests/generated/Function/Function.ql 608e1053c5be5a5d36e4be5cd9da5d4398a0a374adf0ded9f6b652c8b9e085f7 133260e1104616b467aa14a7e0237337aadac918f1b08bd1b9b4f1818fd911e9 +test/extractor-tests/generated/Function/Function.ql 28776a499f21ab36c9dfcb905861cf0bf0a2c51f24d6d9401ca45f67d9f982b0 1ded959dfd9c216975572c4577c6a2d4c56a2d3d4a2dd5b0f3f90adff98d86aa test/extractor-tests/generated/Function/Function_getAbi.ql e5c9c97de036ddd51cae5d99d41847c35c6b2eabbbd145f4467cb501edc606d8 0b81511528bd0ef9e63b19edfc3cb638d8af43eb87d018fad69d6ef8f8221454 test/extractor-tests/generated/Function/Function_getAttr.ql 44067ee11bdec8e91774ff10de0704a8c5c1b60816d587378e86bf3d82e1f660 b4bebf9441bda1f2d1e34e9261e07a7468cbabf53cf8047384f3c8b11869f04e test/extractor-tests/generated/Function/Function_getBody.ql cf2716a751e309deba703ee4da70e607aae767c1961d3c0ac5b6728f7791f608 3beaf4032924720cb881ef6618a3dd22316f88635c86cbc1be60e3bdad173e21 @@ -758,7 +761,7 @@ test/extractor-tests/generated/GenericArgList/GenericArgList.ql 2d3e37da2c02a88e test/extractor-tests/generated/GenericArgList/GenericArgList_getGenericArg.ql 7f92dc62d814c39bc50dfd46c359540261fe433fcad1752ea2fe139a05071183 9863976c97c1b7c07d5d18d8ffee798b1c1b0223784a61066ee2c9ffc46c4979 test/extractor-tests/generated/GenericParamList/GenericParamList.ql 5d04af9be32c5f8bdf9ec679b0acbabd58ff01a20f5543a0c7d4fe5c5773ebba 7e86c4d3ed64b9ef2f928abd22b593d72131862321096722df5150b5202a4a28 test/extractor-tests/generated/GenericParamList/GenericParamList_getGenericParam.ql 7866ed49ebfca1cc1fffeec797329a592f52b4431a5d259aeb7120a7f4961c44 16d89dd05d9db1b1997f801d9e5ba2dd9389d13a3031c730414f3daf5fb7b12f -test/extractor-tests/generated/IdentPat/IdentPat.ql 8fc54811b0fabda503949557737d14a2e71ec68170b6e42e69fde08ba1a2c39d aff69e979a6084eb4e1d902df2bafd0cde806a41ab8ef83336585a60d4e3a7c8 +test/extractor-tests/generated/IdentPat/IdentPat.ql 1e61edbdff611193bbb497eeba8c35043e1d1c6d3359903be58382b1c95e39e4 6f3a288cc12ee24a9ff21ca2fe544838d66f6481e60539cf7d4a473e628e3c3f test/extractor-tests/generated/IdentPat/IdentPat_getAttr.ql 02607c8c616dc94152777390f912fc1e6bb420cc3ea687397e31392848942aa7 aeb10434577815d9a9f0f45a1a448656323f05d5321ff07d435ca4a449527d53 test/extractor-tests/generated/IdentPat/IdentPat_getName.ql b96a3dbca1bade052cad294d95f95504665ad0b14c7f5f9f8083486d0ee64026 28c851703250c25b518024add1052d3204271db3f89eddf862d9a1e122ee6eb0 test/extractor-tests/generated/IdentPat/IdentPat_getPat.ql fea604fee0db39f83a3dadb4583cb53123c63351282bc3387b84f90477be19cb ef2e620ade30e0225f6bf1c84982d1b8f949ee0c2ced5edbd00e5547e0a81a7c @@ -767,7 +770,7 @@ test/extractor-tests/generated/IfExpr/IfExpr_getAttr.ql f5872cdbb21683bed689e753 test/extractor-tests/generated/IfExpr/IfExpr_getCondition.ql 5bab301a1d53fe6ee599edfb17f9c7edb2410ec6ea7108b3f4a5f0a8d14316e3 355183b52cca9dc81591a09891dab799150370fff2034ddcbf7b1e4a7cb43482 test/extractor-tests/generated/IfExpr/IfExpr_getElse.ql 8674cedf42fb7be513fdf6b9c3988308453ae3baf8051649832e7767b366c12f e064e5f0b8e394b080a05a7bccd57277a229c1f985aa4df37daea26aeade4603 test/extractor-tests/generated/IfExpr/IfExpr_getThen.ql 0989ddab2c231c0ee122ae805ffa0d3f0697fb7b6d9e53ee6d32b9140d4b0421 81028f9cd6b417c63091d46a8b85c3b32b1c77eea885f3f93ae12c99685bfe0a -test/extractor-tests/generated/Impl/Impl.ql 2969c1fc9dcc836ac7f40f5a2030b6f90f57a87f8a3da72b253da34c0620d4fe 0453150f2818fc002becd34a9d8cb67bf4df93b00d91b5be9fe053a9ed44aed2 +test/extractor-tests/generated/Impl/Impl.ql b879d3101c31d57c1b7b794c241678214f65fcb1b33ec45919948809d1d62f6c 769c7a691a8034db4cc12bc8cd8df3a8ae765a3fb83bb6a5efe6e310328d800c test/extractor-tests/generated/Impl/Impl_getAssocItemList.ql cf875361c53c081ac967482fd3af8daf735b0bc22f21dcf0936fcf70500a001a 0ad723839fa26d30fa1cd2badd01f9453977eba81add7f0f0a0fcb3adb76b87e test/extractor-tests/generated/Impl/Impl_getAttr.ql 018bdf6d9a9724d4f497d249de7cecd8bda0ac2340bde64b9b3d7c57482e715b cd065899d92aa35aca5d53ef64eadf7bb195d9a4e8ed632378a4e8c550b850cd test/extractor-tests/generated/Impl/Impl_getGenericParamList.ql 88d5cd8fd03cb4cc2887393ee38b2e2315eeef8c4db40a9bd94cf86b95935bdd 9c72828669ccf8f7ca39851bc36a0c426325a91fc428b49681e4bb680d6547a9 @@ -857,7 +860,7 @@ test/extractor-tests/generated/MatchExpr/MatchExpr_getExpr.ql 7baaa64071cf2666e3 test/extractor-tests/generated/MatchExpr/MatchExpr_getMatchArmList.ql d97055bcb0431e8b258b5ecdd98aa07cb24ece06b0cd658b697cd71da4ede8fc 5e9c03b2665ef6b2af98897996abb2e0a9c18d54eb64588340b8efbcee9793bd test/extractor-tests/generated/MatchGuard/MatchGuard.ql 23e47ec1b13e2d80e31b57894a46ec789d6ab5ed1eb66bdb6bba9bd5ae71d3ef 7302f4a93108a83228e0ebd5b4a1bc6bccc1f6f0f3272054866fa90378c0dcc4 test/extractor-tests/generated/MatchGuard/MatchGuard_getCondition.ql 8a79dd46798f111f8d0d5a975380b5cebe5e337267752b77b3718b268ba2773d 6691d8fb483f64fc7e3ad3f46e3129e0a1184d7beb9f83a1000acdbb081c8b5e -test/extractor-tests/generated/Meta/Meta.ql 5edf76c32512f29dbe033a02e12aa81e64ae8998b1eb70c414c08fd400f794d1 34ce5338b4a82437ba2db9e4bfb2810dcd37c463b8d667d483c3f7b3c6ca2a99 +test/extractor-tests/generated/Meta/Meta.ql 16f163f00ba2bbaa0a8c6f3f6710c860a8f61d02d43321c78e05a10a3606e39b ba982c6bb93ddb4fc2c44d24635bd487128a5b1d1f885214044c989a21f4d05a test/extractor-tests/generated/Meta/Meta_getExpr.ql ec9ec61f5be7d65c32775fb5c068daea04f9db7d875293ed99cc1b2481db041f 77a0c52f1cb6ddc8fdb294d637f9eda1b7301ffa3067f0fca6272d894f57d3ee test/extractor-tests/generated/Meta/Meta_getPath.ql aa9d4145a4e613c51b6e4637d57e3b7d0f66e0bb88f4ce959d598870814c06bb 2087e00686d502c0e2e89c88eae0fb354463576a9ae4101320981d3fd79b9078 test/extractor-tests/generated/Meta/Meta_getTokenTree.ql 1051c27ffd0d9a20436d684fde529b9ff55abe30d50e1d575b0318951e75bd34 983975672d928fb907676628384c949731da9807bf0c781bb7ec749d25733d2d @@ -919,7 +922,7 @@ test/extractor-tests/generated/PrefixExpr/PrefixExpr.ql 44fb7174365c6deecdc22c72 test/extractor-tests/generated/PrefixExpr/PrefixExpr_getAttr.ql fdad6ad5199435ded1e4a9ea6b246e76b904cd73a36aaa4780e84eef91741c5b 75d63940046e62c1efa1151b0cac45b5ec0bab5e39aec2e11d43f6c385e37984 test/extractor-tests/generated/PrefixExpr/PrefixExpr_getExpr.ql 2d1d97f6277794871fbb032ea87ac30b1aa902a74cd874720156162057ea202e b1b9880fce07d66df7ec87f12189c37adf9f233a1d0b38a1b09808d052a95642 test/extractor-tests/generated/PrefixExpr/PrefixExpr_getOperatorName.ql d27602e77ddf491a278426de65041dda8568f427d1e0ff97c0f23069ae64670e 4e4766e948adf88a6b003ead7d9de1ad26174fe9e30c370f1d3e666aa944df52 -test/extractor-tests/generated/PtrType/PtrType.ql 6a1cae6f398efe5021e94a945d791da9f01da56a19b25fe7692cbbe7e1a3817c e2d38e534bae46176e26f3941bb0029148cb70b244b61c19d2e9524682f3c5de +test/extractor-tests/generated/PtrType/PtrType.ql 6317c79917e024d2162ae9089c17539fae818288f9ba5976fe39d004691dd343 d7e12a58475322a1292777608056ff90d7014b3e3a77bb756e233014d2670f28 test/extractor-tests/generated/PtrType/PtrType_getTy.ql 97f5e6197e66c4dcf15d4a62692e30a26979f2902d83354911985d39c8560d1a 0b049b882a33be9746fbb704394a024ac320415cfd1707dc48fe114781558e36 test/extractor-tests/generated/RangeExpr/RangeExpr.ql 707c08aab49cc0a22c80a734e663b13ecbbddf0db28b6a25fdbc030a1ce38d6f 1f78950b30485cdde9fe7d9e416ad1dfdac8c5b6bc328172e6e721821c076131 test/extractor-tests/generated/RangeExpr/RangeExpr_getAttr.ql 8767e670f88c2115bc61b16195d2c9d02bc074adc4ca57d2aa537c1af9b4c530 4fa51652c60ca7d06bd9ad604107e002603ee2a7b4587636f6b46b8e8060e06c @@ -958,12 +961,12 @@ test/extractor-tests/generated/RecordPatField/RecordPatField_getPat.ql 577187a47 test/extractor-tests/generated/RecordPatFieldList/RecordPatFieldList.ql 5a49488f43bbac2349d75b3acbb3bca4440d9b3725434fefd1ba2eda2be6feb2 898177f203181e5e095091b0a3f6a92f1323c80862400cbfd85902d783a9160d test/extractor-tests/generated/RecordPatFieldList/RecordPatFieldList_getField.ql 7c0d190762089af3b6f4fb9ef95561bb2107d7476477bdcfce6b313caa61cab1 17c85ac9670c4faea44a76e9e21184a3d5cabc6c3deba083a0b84fb91e3cbe16 test/extractor-tests/generated/RecordPatFieldList/RecordPatFieldList_getRestPat.ql 0caef1f5d09a73a973200e061e09ea5498b855dc19af19c1dc48cd9f20da6857 45c12708b566a5efcc79155b45174fc3ff5a084109043493cffa5216b9054205 -test/extractor-tests/generated/RefExpr/RefExpr.ql 6a4d786b68003295ed2cc9a7a9b2f93d6b91f91e4faa7165537e369c3bb0923c 6dd9467a92ce7e966095c01c0356f8429e340e21c036e3ad5665c6442e705580 +test/extractor-tests/generated/RefExpr/RefExpr.ql 27d5dceb9e50668e77143ff5c4aa07cbe15aeea9829de70f1ddfe18d83690106 b95058b7a0bad4bddb857794901d9b651b2f9e4dd3554e5349a70a52cbbfaff6 test/extractor-tests/generated/RefExpr/RefExpr_getAttr.ql 477fb3fee61395fabf78f76360ea27656432cb9db62e6f1dab1e9f3c75c83d39 5210f2ac54c082b616d8dcb091659cdad08a5d4ae06bf61193c33f208237482f test/extractor-tests/generated/RefExpr/RefExpr_getExpr.ql 180d6417fd7322cabf4143d0ddd7810f65506b172a5c82484b3ef398041636b2 a291f0bec1ec5b3fa6d088b3d1a658889b9a3521c39ff3bb7a5ab22a56b8b20a -test/extractor-tests/generated/RefPat/RefPat.ql 2d2e9b058d66d2183a0795cdd719a36e53d27d9c267eca22e34624c558991250 b95d435925f0bd38a101eb00eab548acbc39a9d7e8fdaa10e1d65f0f72362a9b +test/extractor-tests/generated/RefPat/RefPat.ql ba0f0c0b12394ed80880bea7d80a58791492f1f96a26783c2b19085d11e2fd2b 22aa62c6d4b6e4354f20511f8e6d12e6da9d8b0f0b3509eefe7a0c50f7acfb49 test/extractor-tests/generated/RefPat/RefPat_getPat.ql 60f5e010b90c2c62d26674323d209b7e46c1c2b968a69765e1b1cde028893111 fe9e7dc6a5459250355336eca0bdf2a0be575b1e34936280fd12a76a004f7b46 -test/extractor-tests/generated/RefType/RefType.ql d5b822b2e4ffd6a85aac88cc37d113d321029ae042cacb66cb63cd7169faa1eb 3a4a866bc02d733236ebb2b32565bf6a00976afbea3cf50ef1d2271e4ebac9a5 +test/extractor-tests/generated/RefType/RefType.ql f6959c993a8e401a576c785fd1be4b910be218a212eaa9363ebf8f83dc2f1950 686678725a7f9824e74ec6dda294fc2233fd94aced8e2683b7019a1ce81f345d test/extractor-tests/generated/RefType/RefType_getLifetime.ql 880434f5908752adcc02d3645a48f22399250600c19e43c2da852cb6242e6a0b b8f9b9fab827972fd318d5edcaf37e4c7d0cf92261f9744e258537e6aee5a87a test/extractor-tests/generated/RefType/RefType_getTy.ql 0d5667542ad05a0da1a6a4c36882a39014c4803a76cadb11400d747b603890fd 2e6c3a56f1a7bbb72c181819be72d85c650af1df06f8582ae61bba9e165cf764 test/extractor-tests/generated/Rename/Rename.ql c8605e5d8ebb39be238ba26e46861df493d86c9caf9aa9a791ed5ff8d65a812a 7263c2c2565e41c652eda03d1e1ddd030fea79a8e3c967909df9945e30ecbe68 @@ -976,7 +979,7 @@ test/extractor-tests/generated/ReturnExpr/ReturnExpr.ql 8e9eba0837a466255e8e249e test/extractor-tests/generated/ReturnExpr/ReturnExpr_getAttr.ql 9fb7e1c79798e4f42e18785f3af17ea75f901a36abf9beb47a1eede69c613ba9 9cdb7cc4a4742865f6c92357973f84cee9229f55ff28081e5d17b6d57d6d275f test/extractor-tests/generated/ReturnExpr/ReturnExpr_getExpr.ql 7d4562efb0d26d92d11f03a0ef80338eb7d5a0c073f1f09cbb8a826f0cef33de 523ebd51b97f957afaf497e5a4d27929eed18e1d276054e3d5a7c5cfe7285c6e test/extractor-tests/generated/ReturnTypeSyntax/ReturnTypeSyntax.ql 976ce33fe3fd34aae2028a11b4accdee122b6d82d07722488c3239f0d2c14609 906bf8c8e7769a1052196bc78947b655158dd3b2903fef2802e2031cffbc1d78 -test/extractor-tests/generated/SelfParam/SelfParam.ql 61977791634b816d79507478a0be913befc843257fea1d6c564de58ff6d22cce 3e33365f58f59f61e0d190f1bfb101d5fc8f086d24322a7ca464e2a397b90110 +test/extractor-tests/generated/SelfParam/SelfParam.ql d051c7a2dd88382e37895f1d691f2702aed7f925d3936f51d49949463e4757c8 37f1f429093be7923a55f8b4f46b37bbf71d0dff3843c4d3686383c2863dee1a test/extractor-tests/generated/SelfParam/SelfParam_getAttr.ql 00dd5409c07e9a7b5dc51c1444e24b35d2ac3cab11320396ef70f531a3b65dc0 effbed79ad530a835e85b931389a0c8609a10ee035cb694f2e39b8539f8e54ba test/extractor-tests/generated/SelfParam/SelfParam_getLifetime.ql 0b7c243f609e005dd63fd1b3b9f0096fc13cb98fe113e6f3fefb0d5c414e9a5f f6e06de8bcddfc9bd978c058079e53174edbe7b39f18df3c0bd4e80486808eda test/extractor-tests/generated/SelfParam/SelfParam_getName.ql 69207a57b415ba590e50003d506a64fd1780b27b8832b14f9bd3c909bddb5593 56fa28ba1222f45893237052fa5a9421d960e14fbf1396b2d1049b440c2e5abe @@ -988,7 +991,7 @@ test/extractor-tests/generated/SliceType/SliceType_getTy.ql 0bc70c0e60fc3552584b test/extractor-tests/generated/SourceFile/SourceFile.ql c30a3c2c82be3114f3857295615e2ec1e59c823f0b65ea3918be85e6b7adb921 6a5bbe96f81861c953eb89f77ea64d580f996dca5950f717dd257a0b795453e6 test/extractor-tests/generated/SourceFile/SourceFile_getAttr.ql 450404306b3d991b23c60a7bb354631d37925e74dec7cc795452fe3263dc2358 07ffcc91523fd029bd599be28fe2fc909917e22f2b95c4257d3605f54f9d7551 test/extractor-tests/generated/SourceFile/SourceFile_getItem.ql f17e44bc0c829b2aadcb6d4ab9c687c10dc8f1afbed4e5190404e574d6ab3107 1cf49a37cc32a67fdc00d16b520daf39143e1b27205c1a610e24d2fe1a464b95 -test/extractor-tests/generated/Static/Static.ql 0a704360ff0075d90b0ab68e447892728036b55dd62ac87aba162155a920bfc2 1004434e09a18db400e57e1901555cfc20e7be743d4ec5a07beab5e163822f30 +test/extractor-tests/generated/Static/Static.ql 605b1c3b5664db0c8738c4159af0958a3d73ee4a180a8e022c1ef6b214d3d26f eb351abb9d55816b9d05c3849913074faf272a8ff267919a3d98d23ae67c7b5b test/extractor-tests/generated/Static/Static_getAttr.ql adb0bbf55fb962c0e9d317fd815c09c88793c04f2fb78dfd62c259420c70bc68 d317429171c69c4d5d926c26e97b47f5df87cf0552338f575cd3aeea0e57d2c2 test/extractor-tests/generated/Static/Static_getBody.ql e735bbd421e22c67db792671f5cb78291c437621fdfd700e5ef13b5b76b3684d 9148dc9d1899cedf817258a30a274e4f2c34659140090ca2afeb1b6f2f21e52f test/extractor-tests/generated/Static/Static_getName.ql c7537e166d994b6f961547e8b97ab4328b78cbd038a0eb9afaae42e35f6d9cb4 bb5ae24b85cd7a8340a4ce9e9d56ec3be31558051c82257ccb84289291f38a42 @@ -1006,7 +1009,7 @@ test/extractor-tests/generated/Struct/Struct_getName.ql 8f1d9da4013307b4d23a1ce5 test/extractor-tests/generated/Struct/Struct_getVisibility.ql 17139d3f91e02a0fc12ad8443fe166fe11003301fee0c303f13aa6d1138e82d5 07bdc1fbcc0ea40508364ea632fce899cbe734159f5c377ea2029bc41bc9a3b4 test/extractor-tests/generated/Struct/Struct_getWhereClause.ql d0db2c9811ed4568359e84255f04f0c75ae65a80d40981a1545d6cddf53e9c09 1133a46bc502757aaab61a8ac94b4a256b590548c5e27ec6a239ffd5a4a81577 test/extractor-tests/generated/TokenTree/TokenTree.ql ba2ef197e0566640b57503579f3bc811a16fec56f4817117395bf81da08922a6 2e7b105cb917a444171669eb06f5491a4b222b1f81fa79209a138ab97db85aff -test/extractor-tests/generated/Trait/Trait.ql a51ba80b65687fb6eb99f36e4f98565b4a9ed9cc97d2c7ad2f09254ec9089b3d 81783aedb5af5a09f470ec0df6694588a4dcf8390b1b1645fb7459d35bc1bc3e +test/extractor-tests/generated/Trait/Trait.ql a80249a821a91e11592227126209090ce5ced83a6168136f7c53db61b5bc3914 4555281baf4d9f736a68d28c6c7b788b913933a38503a323783d57db9e8c5c02 test/extractor-tests/generated/Trait/Trait_getAssocItemList.ql 05e6896f60afabf931a244e42f75ee55e09c749954a751d8895846de3121f58f def1f07d9945e8d9b45a659a285b0eb72b37509d20624c88e0a2d34abf7f0c72 test/extractor-tests/generated/Trait/Trait_getAttr.ql 9711125fa4fc0212b6357f06d1bc50df50b46168d139b649034296c64d732e21 901b6a9d04055b563f13d8742bd770c76ed1b2ccf9a7236a64de9d6d287fbd52 test/extractor-tests/generated/Trait/Trait_getGenericParamList.ql b27ff28e3aff9ec3369bbbcbee40a07a4bd8af40928c8c1cb7dd1e407a88ffee 2b48e2049df18de61ae3026f8ab4c3e9e517f411605328b37a0b71b288826925 @@ -1040,7 +1043,7 @@ test/extractor-tests/generated/TupleStructPat/TupleStructPat_getField.ql f3f2e23 test/extractor-tests/generated/TupleStructPat/TupleStructPat_getPath.ql 13a06696bbf1fa8d5b73107e28cdba40e93da04b27f9c54381b78a52368d2ad1 5558c35ea9bb371ad90a5b374d7530dd1936f83e6ba656ebfbfd5bd63598e088 test/extractor-tests/generated/TupleType/TupleType.ql e5951a30817b8c51fe9cb9435f75bfdca2a1277b2094267d3205e33ef1ee9a9c 9a4d57322ed2cff57057654272981b056f833136f983141b033afaf64e19c117 test/extractor-tests/generated/TupleType/TupleType_getField.ql b73a8cdaf6ba46cf9b63d8819239d2d2c06b3496ed4768e8a387a7558178fbd8 6efbcf13c25d0ff3ed0c6d194ba44d2abfa620406badef8184953395fab92bb4 -test/extractor-tests/generated/TypeAlias/TypeAlias.ql be2f90fb1bab4f8b77687f93f0fb7180582a0a3b3bb1a5e9fb77d55c12b01048 7fb298034353d13193e6b2fbb95b2cb2f7fa11c9eff7bd10bd7180f02267883f +test/extractor-tests/generated/TypeAlias/TypeAlias.ql 8fc7144467f3be85ffcc661630cc144a244b636220aca69f1074f8b7221eb32f 692417975c0062d4d324e8a4b5c4a95bc352bfbab03664f671240739d1ddfcfc test/extractor-tests/generated/TypeAlias/TypeAlias_getAttr.ql ecf4b45ef4876e46252785d2e42b11207e65757cdb26e60decafd765e7b03b49 21bb4d635d3d38abd731b9ad1a2b871f8e0788f48a03e9572823abeea0ea9382 test/extractor-tests/generated/TypeAlias/TypeAlias_getGenericParamList.ql e7e936458dce5a8c6675485a49e2769b6dbff29c112ed744c880e0fc7ae740ef e5fcf3a33d2416db6b0a73401a3cbc0cece22d0e06794e01a1645f2b3bca9306 test/extractor-tests/generated/TypeAlias/TypeAlias_getName.ql 757deb3493764677de3eb1ff7cc119a469482b7277ed01eb8aa0c38b4a8797fb 5efed24a6968544b10ff44bfac7d0432a9621bde0e53b8477563d600d4847825 @@ -1050,7 +1053,7 @@ test/extractor-tests/generated/TypeAlias/TypeAlias_getVisibility.ql a1851a78f31a test/extractor-tests/generated/TypeAlias/TypeAlias_getWhereClause.ql 0cd281b7b5d3a76e4ec1938d7dcebb41e24ed54e94f352dcf48cbcdb5d48b353 5898e71246d8ba7517dab1f8d726af02a7add79924c8e6b30ce2c760e1344e8f test/extractor-tests/generated/TypeArg/TypeArg.ql 8019f0eb5a64162df88e7e64ba0355578dad158b884c8eb42b2f10e093e52121 4871ac369925228978a1e16cf1393a449ea846657893d8a760fb46dbd6a0d609 test/extractor-tests/generated/TypeArg/TypeArg_getTy.ql 54c291039d88fb460b0bc6bb83938c3be272898512415d08abffea714a000275 3117f1bbc1168b0ff75948459673c50971e3e71b0bb966783a8dc44328803f33 -test/extractor-tests/generated/TypeBound/TypeBound.ql 8824b2133040a1c39ed74d3b90669e4d8859a9dd52090e3fd71fe0d8ef90c7f0 932a0361678a16c7f538d5ee9133a61c495234de323e1e012f0ae307c8d2170e +test/extractor-tests/generated/TypeBound/TypeBound.ql f49bc5b12f9817d9464c771bd35837c1ae6c8b3162ab6b0fc9b3e6748d18e87a 2535af71fa8e212d6f9b9e10ca0ba7958808dea4d1af432e1d5167a681d7779c test/extractor-tests/generated/TypeBound/TypeBound_getGenericParamList.ql 7cf4ce64ea8048b85733fc2de627480465a616d62f57345c25bb62fdfda0ca59 e63b77ed3555b150cebf205016b1cc8d1b10fda315d5a21b3e60753ad602ea8f test/extractor-tests/generated/TypeBound/TypeBound_getLifetime.ql 615b0f5ccbffc425a3fa9480197bfae649c072717697f59d2e9b8112d2ff3fcf 1f969aca15be820eb27fe80317ad7fd4ce60f1a0fbcb4ae98b04828b0aeca632 test/extractor-tests/generated/TypeBound/TypeBound_getTy.ql bded40be75f99b97869e5b4701a479db91867a861fb9f2071f4f7df0980ac6a2 6bdb30e50ba3ab7c2976aa602bae54a089019c8b81cab497c962b6b96362fbab diff --git a/rust/ql/.gitattributes b/rust/ql/.gitattributes index 22b87763a2d9..279ded89eede 100644 --- a/rust/ql/.gitattributes +++ b/rust/ql/.gitattributes @@ -17,6 +17,7 @@ /lib/codeql/rust/elements/BoxPat.qll linguist-generated /lib/codeql/rust/elements/BreakExpr.qll linguist-generated /lib/codeql/rust/elements/CallExpr.qll linguist-generated +/lib/codeql/rust/elements/CallExprBase.qll linguist-generated /lib/codeql/rust/elements/CastExpr.qll linguist-generated /lib/codeql/rust/elements/ClosureBinder.qll linguist-generated /lib/codeql/rust/elements/ClosureExpr.qll linguist-generated @@ -187,6 +188,7 @@ /lib/codeql/rust/elements/internal/BoxPatConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/BoxPatImpl.qll linguist-generated /lib/codeql/rust/elements/internal/BreakExprConstructor.qll linguist-generated +/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll linguist-generated /lib/codeql/rust/elements/internal/CallExprConstructor.qll linguist-generated /lib/codeql/rust/elements/internal/CallExprImpl.qll linguist-generated /lib/codeql/rust/elements/internal/CastExprConstructor.qll linguist-generated @@ -468,6 +470,7 @@ /lib/codeql/rust/elements/internal/generated/BoxPat.qll linguist-generated /lib/codeql/rust/elements/internal/generated/BreakExpr.qll linguist-generated /lib/codeql/rust/elements/internal/generated/CallExpr.qll linguist-generated +/lib/codeql/rust/elements/internal/generated/CallExprBase.qll linguist-generated /lib/codeql/rust/elements/internal/generated/CastExpr.qll linguist-generated /lib/codeql/rust/elements/internal/generated/ClosureBinder.qll linguist-generated /lib/codeql/rust/elements/internal/generated/ClosureExpr.qll linguist-generated diff --git a/rust/ql/consistency-queries/ExtractionConsistency.ql b/rust/ql/consistency-queries/ExtractionConsistency.ql index b839f2ad783c..20148f0cea2d 100644 --- a/rust/ql/consistency-queries/ExtractionConsistency.ql +++ b/rust/ql/consistency-queries/ExtractionConsistency.ql @@ -1,3 +1,5 @@ import codeql.rust.Diagnostics query predicate extractionError(ExtractionError ee) { any() } + +query predicate extractionWarning(ExtractionWarning ew) { any() } diff --git a/rust/ql/lib/codeql/files/FileSystem.qll b/rust/ql/lib/codeql/files/FileSystem.qll index 95ca925a8840..7136dcc3b5a2 100644 --- a/rust/ql/lib/codeql/files/FileSystem.qll +++ b/rust/ql/lib/codeql/files/FileSystem.qll @@ -5,6 +5,7 @@ private import codeql.util.FileSystem private import codeql.rust.elements.SourceFile private import codeql.rust.elements.AstNode private import codeql.rust.elements.Comment +private import codeql.rust.Diagnostics private module Input implements InputSig { abstract class ContainerBase extends @container { @@ -56,3 +57,20 @@ class File extends Container, Impl::File { ) } } + +/** + * A successfully extracted file, that is, a file that was extracted and + * contains no extraction errors or warnings. + */ +class SuccessfullyExtractedFile extends File { + SuccessfullyExtractedFile() { + not exists(Diagnostic d | + d.getLocation().getFile() = this and + ( + d instanceof ExtractionError + or + d instanceof ExtractionWarning + ) + ) + } +} diff --git a/rust/ql/lib/codeql/rust/Diagnostics.qll b/rust/ql/lib/codeql/rust/Diagnostics.qll index 5902bb594141..58de14b8fcf5 100644 --- a/rust/ql/lib/codeql/rust/Diagnostics.qll +++ b/rust/ql/lib/codeql/rust/Diagnostics.qll @@ -48,7 +48,8 @@ class Diagnostic extends @diagnostic { string toString() { result = this.getMessage() } } -/** A diagnostic relating to a particular error in extracting a file. */ -class ExtractionError extends Diagnostic { - ExtractionError() { this.getTag() = "parse_error" } -} +/** A diagnostic that is error severity. */ +class ExtractionError extends Diagnostic, @diagnostic_error { } + +/** A diagnostic that is warning severity. */ +class ExtractionWarning extends Diagnostic, @diagnostic_warning { } diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/SuccessorType.qll b/rust/ql/lib/codeql/rust/controlflow/internal/SuccessorType.qll index ba76888bd303..0b88c9f05cb4 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/SuccessorType.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/SuccessorType.qll @@ -2,14 +2,6 @@ private import rust private import codeql.util.Boolean private import Completion -newtype TLoopJumpType = - TContinueJump() or - TBreakJump() - -newtype TLabelType = - TLabel(string s) { any(Label l).getLifetime().getText() = s } or - TNoLabel() - cached newtype TSuccessorType = TSuccessorSuccessor() or diff --git a/rust/ql/lib/codeql/rust/elements.qll b/rust/ql/lib/codeql/rust/elements.qll index 2e4c30b48a6a..c39b6b397289 100644 --- a/rust/ql/lib/codeql/rust/elements.qll +++ b/rust/ql/lib/codeql/rust/elements.qll @@ -20,6 +20,7 @@ import codeql.rust.elements.BlockExpr import codeql.rust.elements.BoxPat import codeql.rust.elements.BreakExpr import codeql.rust.elements.CallExpr +import codeql.rust.elements.CallExprBase import codeql.rust.elements.CastExpr import codeql.rust.elements.ClosureBinder import codeql.rust.elements.ClosureExpr diff --git a/rust/ql/lib/codeql/rust/elements/CallExpr.qll b/rust/ql/lib/codeql/rust/elements/CallExpr.qll index 7047d6a8c3cf..ab5631b07ca7 100644 --- a/rust/ql/lib/codeql/rust/elements/CallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/CallExpr.qll @@ -4,8 +4,7 @@ */ private import internal.CallExprImpl -import codeql.rust.elements.ArgList -import codeql.rust.elements.Attr +import codeql.rust.elements.CallExprBase import codeql.rust.elements.Expr /** diff --git a/rust/ql/lib/codeql/rust/elements/CallExprBase.qll b/rust/ql/lib/codeql/rust/elements/CallExprBase.qll new file mode 100644 index 000000000000..d59c4c705f7c --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/CallExprBase.qll @@ -0,0 +1,14 @@ +// generated by codegen, do not edit +/** + * This module provides the public class `CallExprBase`. + */ + +private import internal.CallExprBaseImpl +import codeql.rust.elements.ArgList +import codeql.rust.elements.Attr +import codeql.rust.elements.Expr + +/** + * A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. + */ +final class CallExprBase = Impl::CallExprBase; diff --git a/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll b/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll index ec3d305f63cf..fca8b0861345 100644 --- a/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/MethodCallExpr.qll @@ -4,8 +4,7 @@ */ private import internal.MethodCallExprImpl -import codeql.rust.elements.ArgList -import codeql.rust.elements.Attr +import codeql.rust.elements.CallExprBase import codeql.rust.elements.Expr import codeql.rust.elements.GenericArgList import codeql.rust.elements.NameRef diff --git a/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll b/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll new file mode 100644 index 000000000000..332ba0fb6b3f --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/internal/CallExprBaseImpl.qll @@ -0,0 +1,19 @@ +// generated by codegen, remove this comment if you wish to edit this file +/** + * This module provides a hand-modifiable wrapper around the generated class `CallExprBase`. + * + * INTERNAL: Do not use. + */ + +private import codeql.rust.elements.internal.generated.CallExprBase + +/** + * INTERNAL: This module contains the customizable definition of `CallExprBase` and should not + * be referenced directly. + */ +module Impl { + /** + * A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. + */ + class CallExprBase extends Generated::CallExprBase { } +} diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/BlockExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/BlockExpr.qll index 7627172ee83c..c4f11fdd90c5 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/BlockExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/BlockExpr.qll @@ -53,6 +53,36 @@ module Generated { */ final int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) } + /** + * Holds if this block expression is async. + */ + predicate isAsync() { Synth::convertBlockExprToRaw(this).(Raw::BlockExpr).isAsync() } + + /** + * Holds if this block expression is const. + */ + predicate isConst() { Synth::convertBlockExprToRaw(this).(Raw::BlockExpr).isConst() } + + /** + * Holds if this block expression is gen. + */ + predicate isGen() { Synth::convertBlockExprToRaw(this).(Raw::BlockExpr).isGen() } + + /** + * Holds if this block expression is move. + */ + predicate isMove() { Synth::convertBlockExprToRaw(this).(Raw::BlockExpr).isMove() } + + /** + * Holds if this block expression is try. + */ + predicate isTry() { Synth::convertBlockExprToRaw(this).(Raw::BlockExpr).isTry() } + + /** + * Holds if this block expression is unsafe. + */ + predicate isUnsafe() { Synth::convertBlockExprToRaw(this).(Raw::BlockExpr).isUnsafe() } + /** * Gets the label of this block expression, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/CallExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/CallExpr.qll index f7b27e6e2a84..2e41b664a4ee 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/CallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/CallExpr.qll @@ -6,10 +6,8 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw -import codeql.rust.elements.ArgList -import codeql.rust.elements.Attr +import codeql.rust.elements.internal.CallExprBaseImpl::Impl as CallExprBaseImpl import codeql.rust.elements.Expr -import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl /** * INTERNAL: This module contains the fully generated definition of `CallExpr` and should not @@ -27,40 +25,9 @@ module Generated { * INTERNAL: Do not reference the `Generated::CallExpr` class directly. * Use the subclass `CallExpr`, where the following predicates are available. */ - class CallExpr extends Synth::TCallExpr, ExprImpl::Expr { + class CallExpr extends Synth::TCallExpr, CallExprBaseImpl::CallExprBase { override string getAPrimaryQlClass() { result = "CallExpr" } - /** - * Gets the argument list of this call expression, if it exists. - */ - ArgList getArgList() { - result = - Synth::convertArgListFromRaw(Synth::convertCallExprToRaw(this).(Raw::CallExpr).getArgList()) - } - - /** - * Holds if `getArgList()` exists. - */ - final predicate hasArgList() { exists(this.getArgList()) } - - /** - * Gets the `index`th attr of this call expression (0-based). - */ - Attr getAttr(int index) { - result = - Synth::convertAttrFromRaw(Synth::convertCallExprToRaw(this).(Raw::CallExpr).getAttr(index)) - } - - /** - * Gets any of the attrs of this call expression. - */ - final Attr getAnAttr() { result = this.getAttr(_) } - - /** - * Gets the number of attrs of this call expression. - */ - final int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) } - /** * Gets the expression of this call expression, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/CallExprBase.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/CallExprBase.qll new file mode 100644 index 000000000000..046558c356d2 --- /dev/null +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/CallExprBase.qll @@ -0,0 +1,59 @@ +// generated by codegen, do not edit +/** + * This module provides the generated definition of `CallExprBase`. + * INTERNAL: Do not import directly. + */ + +private import codeql.rust.elements.internal.generated.Synth +private import codeql.rust.elements.internal.generated.Raw +import codeql.rust.elements.ArgList +import codeql.rust.elements.Attr +import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl + +/** + * INTERNAL: This module contains the fully generated definition of `CallExprBase` and should not + * be referenced directly. + */ +module Generated { + /** + * A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. + * INTERNAL: Do not reference the `Generated::CallExprBase` class directly. + * Use the subclass `CallExprBase`, where the following predicates are available. + */ + class CallExprBase extends Synth::TCallExprBase, ExprImpl::Expr { + /** + * Gets the argument list of this call expression base, if it exists. + */ + ArgList getArgList() { + result = + Synth::convertArgListFromRaw(Synth::convertCallExprBaseToRaw(this) + .(Raw::CallExprBase) + .getArgList()) + } + + /** + * Holds if `getArgList()` exists. + */ + final predicate hasArgList() { exists(this.getArgList()) } + + /** + * Gets the `index`th attr of this call expression base (0-based). + */ + Attr getAttr(int index) { + result = + Synth::convertAttrFromRaw(Synth::convertCallExprBaseToRaw(this) + .(Raw::CallExprBase) + .getAttr(index)) + } + + /** + * Gets any of the attrs of this call expression base. + */ + final Attr getAnAttr() { result = this.getAttr(_) } + + /** + * Gets the number of attrs of this call expression base. + */ + final int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) } + } +} diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ClosureExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ClosureExpr.qll index 54a703414710..6538501d9a26 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ClosureExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ClosureExpr.qll @@ -83,6 +83,31 @@ module Generated { */ final predicate hasClosureBinder() { exists(this.getClosureBinder()) } + /** + * Holds if this closure expression is async. + */ + predicate isAsync() { Synth::convertClosureExprToRaw(this).(Raw::ClosureExpr).isAsync() } + + /** + * Holds if this closure expression is const. + */ + predicate isConst() { Synth::convertClosureExprToRaw(this).(Raw::ClosureExpr).isConst() } + + /** + * Holds if this closure expression is gen. + */ + predicate isGen() { Synth::convertClosureExprToRaw(this).(Raw::ClosureExpr).isGen() } + + /** + * Holds if this closure expression is move. + */ + predicate isMove() { Synth::convertClosureExprToRaw(this).(Raw::ClosureExpr).isMove() } + + /** + * Holds if this closure expression is static. + */ + predicate isStatic() { Synth::convertClosureExprToRaw(this).(Raw::ClosureExpr).isStatic() } + /** * Gets the parameter list of this closure expression, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Const.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Const.qll index 37c3b55204db..a9b1932a935b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Const.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Const.qll @@ -59,6 +59,16 @@ module Generated { */ final predicate hasBody() { exists(this.getBody()) } + /** + * Holds if this const is const. + */ + predicate isConst() { Synth::convertConstToRaw(this).(Raw::Const).isConst() } + + /** + * Holds if this const is default. + */ + predicate isDefault() { Synth::convertConstToRaw(this).(Raw::Const).isDefault() } + /** * Gets the name of this const, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ConstBlockPat.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ConstBlockPat.qll index 81e0319919ab..2935c7c8f85b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ConstBlockPat.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ConstBlockPat.qll @@ -42,5 +42,10 @@ module Generated { * Holds if `getBlockExpr()` exists. */ final predicate hasBlockExpr() { exists(this.getBlockExpr()) } + + /** + * Holds if this const block pat is const. + */ + predicate isConst() { Synth::convertConstBlockPatToRaw(this).(Raw::ConstBlockPat).isConst() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ConstParam.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ConstParam.qll index c4f6cfa022da..451234d3dc1b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ConstParam.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ConstParam.qll @@ -63,6 +63,11 @@ module Generated { */ final predicate hasDefaultVal() { exists(this.getDefaultVal()) } + /** + * Holds if this const parameter is const. + */ + predicate isConst() { Synth::convertConstParamToRaw(this).(Raw::ConstParam).isConst() } + /** * Gets the name of this const parameter, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ExternBlock.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ExternBlock.qll index f259e509c1e4..823bf4173c4b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ExternBlock.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ExternBlock.qll @@ -74,5 +74,10 @@ module Generated { * Holds if `getExternItemList()` exists. */ final predicate hasExternItemList() { exists(this.getExternItemList()) } + + /** + * Holds if this extern block is unsafe. + */ + predicate isUnsafe() { Synth::convertExternBlockToRaw(this).(Raw::ExternBlock).isUnsafe() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/FnPtrType.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/FnPtrType.qll index 4f8f2feb07c7..8296c401fa85 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/FnPtrType.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/FnPtrType.qll @@ -40,6 +40,21 @@ module Generated { */ final predicate hasAbi() { exists(this.getAbi()) } + /** + * Holds if this fn ptr type is async. + */ + predicate isAsync() { Synth::convertFnPtrTypeToRaw(this).(Raw::FnPtrType).isAsync() } + + /** + * Holds if this fn ptr type is const. + */ + predicate isConst() { Synth::convertFnPtrTypeToRaw(this).(Raw::FnPtrType).isConst() } + + /** + * Holds if this fn ptr type is unsafe. + */ + predicate isUnsafe() { Synth::convertFnPtrTypeToRaw(this).(Raw::FnPtrType).isUnsafe() } + /** * Gets the parameter list of this fn ptr type, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Function.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Function.qll index 82bfe1df7dfe..4c4513d9e33b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Function.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Function.qll @@ -101,6 +101,31 @@ module Generated { */ final predicate hasGenericParamList() { exists(this.getGenericParamList()) } + /** + * Holds if this function is async. + */ + predicate isAsync() { Synth::convertFunctionToRaw(this).(Raw::Function).isAsync() } + + /** + * Holds if this function is const. + */ + predicate isConst() { Synth::convertFunctionToRaw(this).(Raw::Function).isConst() } + + /** + * Holds if this function is default. + */ + predicate isDefault() { Synth::convertFunctionToRaw(this).(Raw::Function).isDefault() } + + /** + * Holds if this function is gen. + */ + predicate isGen() { Synth::convertFunctionToRaw(this).(Raw::Function).isGen() } + + /** + * Holds if this function is unsafe. + */ + predicate isUnsafe() { Synth::convertFunctionToRaw(this).(Raw::Function).isUnsafe() } + /** * Gets the name of this function, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/IdentPat.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/IdentPat.qll index bf77fbc3c083..275272f06a0d 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/IdentPat.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/IdentPat.qll @@ -54,6 +54,16 @@ module Generated { */ final int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) } + /** + * Holds if this ident pat is mut. + */ + predicate isMut() { Synth::convertIdentPatToRaw(this).(Raw::IdentPat).isMut() } + + /** + * Holds if this ident pat is reference. + */ + predicate isRef() { Synth::convertIdentPatToRaw(this).(Raw::IdentPat).isRef() } + /** * Gets the name of this ident pat, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Impl.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Impl.qll index 1b99ed4745b1..14ec8ee38630 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Impl.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Impl.qll @@ -77,6 +77,21 @@ module Generated { */ final predicate hasGenericParamList() { exists(this.getGenericParamList()) } + /** + * Holds if this impl is const. + */ + predicate isConst() { Synth::convertImplToRaw(this).(Raw::Impl).isConst() } + + /** + * Holds if this impl is default. + */ + predicate isDefault() { Synth::convertImplToRaw(this).(Raw::Impl).isDefault() } + + /** + * Holds if this impl is unsafe. + */ + predicate isUnsafe() { Synth::convertImplToRaw(this).(Raw::Impl).isUnsafe() } + /** * Gets the self ty of this impl, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Meta.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Meta.qll index 146c08a9b1e6..9f4252af3090 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Meta.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Meta.qll @@ -39,6 +39,11 @@ module Generated { */ final predicate hasExpr() { exists(this.getExpr()) } + /** + * Holds if this meta is unsafe. + */ + predicate isUnsafe() { Synth::convertMetaToRaw(this).(Raw::Meta).isUnsafe() } + /** * Gets the path of this meta, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll index 0cc8f2437065..4aeb89e8e85b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/MethodCallExpr.qll @@ -6,10 +6,8 @@ private import codeql.rust.elements.internal.generated.Synth private import codeql.rust.elements.internal.generated.Raw -import codeql.rust.elements.ArgList -import codeql.rust.elements.Attr +import codeql.rust.elements.internal.CallExprBaseImpl::Impl as CallExprBaseImpl import codeql.rust.elements.Expr -import codeql.rust.elements.internal.ExprImpl::Impl as ExprImpl import codeql.rust.elements.GenericArgList import codeql.rust.elements.NameRef @@ -27,44 +25,9 @@ module Generated { * INTERNAL: Do not reference the `Generated::MethodCallExpr` class directly. * Use the subclass `MethodCallExpr`, where the following predicates are available. */ - class MethodCallExpr extends Synth::TMethodCallExpr, ExprImpl::Expr { + class MethodCallExpr extends Synth::TMethodCallExpr, CallExprBaseImpl::CallExprBase { override string getAPrimaryQlClass() { result = "MethodCallExpr" } - /** - * Gets the argument list of this method call expression, if it exists. - */ - ArgList getArgList() { - result = - Synth::convertArgListFromRaw(Synth::convertMethodCallExprToRaw(this) - .(Raw::MethodCallExpr) - .getArgList()) - } - - /** - * Holds if `getArgList()` exists. - */ - final predicate hasArgList() { exists(this.getArgList()) } - - /** - * Gets the `index`th attr of this method call expression (0-based). - */ - Attr getAttr(int index) { - result = - Synth::convertAttrFromRaw(Synth::convertMethodCallExprToRaw(this) - .(Raw::MethodCallExpr) - .getAttr(index)) - } - - /** - * Gets any of the attrs of this method call expression. - */ - final Attr getAnAttr() { result = this.getAttr(_) } - - /** - * Gets the number of attrs of this method call expression. - */ - final int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) } - /** * Gets the generic argument list of this method call expression, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll index 67d3a2523949..7eef4c186218 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll @@ -1417,14 +1417,15 @@ private module Impl { ) } - private Element getImmediateChildOfCallExpr(CallExpr e, int index, string partialPredicateCall) { - exists(int b, int bExpr, int n, int nArgList, int nAttr, int nExpr | + private Element getImmediateChildOfCallExprBase( + CallExprBase e, int index, string partialPredicateCall + ) { + exists(int b, int bExpr, int n, int nArgList, int nAttr | b = 0 and bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and n = bExpr and nArgList = n + 1 and nAttr = nArgList + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - nExpr = nAttr + 1 and ( none() or @@ -1434,8 +1435,6 @@ private module Impl { or result = e.getAttr(index - nArgList) and partialPredicateCall = "Attr(" + (index - nArgList).toString() + ")" - or - index = nAttr and result = e.getExpr() and partialPredicateCall = "Expr()" ) ) } @@ -2095,42 +2094,6 @@ private module Impl { ) } - private Element getImmediateChildOfMethodCallExpr( - MethodCallExpr e, int index, string partialPredicateCall - ) { - exists( - int b, int bExpr, int n, int nArgList, int nAttr, int nGenericArgList, int nNameRef, - int nReceiver - | - b = 0 and - bExpr = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfExpr(e, i, _)) | i) and - n = bExpr and - nArgList = n + 1 and - nAttr = nArgList + 1 + max(int i | i = -1 or exists(e.getAttr(i)) | i) and - nGenericArgList = nAttr + 1 and - nNameRef = nGenericArgList + 1 and - nReceiver = nNameRef + 1 and - ( - none() - or - result = getImmediateChildOfExpr(e, index - b, partialPredicateCall) - or - index = n and result = e.getArgList() and partialPredicateCall = "ArgList()" - or - result = e.getAttr(index - nArgList) and - partialPredicateCall = "Attr(" + (index - nArgList).toString() + ")" - or - index = nAttr and - result = e.getGenericArgList() and - partialPredicateCall = "GenericArgList()" - or - index = nGenericArgList and result = e.getNameRef() and partialPredicateCall = "NameRef()" - or - index = nNameRef and result = e.getReceiver() and partialPredicateCall = "Receiver()" - ) - ) - } - private Element getImmediateChildOfNeverType(NeverType e, int index, string partialPredicateCall) { exists(int b, int bTypeRef, int n | b = 0 and @@ -2817,6 +2780,23 @@ private module Impl { ) } + private Element getImmediateChildOfCallExpr(CallExpr e, int index, string partialPredicateCall) { + exists(int b, int bCallExprBase, int n, int nExpr | + b = 0 and + bCallExprBase = + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfCallExprBase(e, i, _)) | i) and + n = bCallExprBase and + nExpr = n + 1 and + ( + none() + or + result = getImmediateChildOfCallExprBase(e, index - b, partialPredicateCall) + or + index = n and result = e.getExpr() and partialPredicateCall = "Expr()" + ) + ) + } + private Element getImmediateChildOfConst(Const e, int index, string partialPredicateCall) { exists( int b, int bAssocItem, int bItem, int n, int nAttr, int nBody, int nName, int nTy, @@ -3137,6 +3117,31 @@ private module Impl { ) } + private Element getImmediateChildOfMethodCallExpr( + MethodCallExpr e, int index, string partialPredicateCall + ) { + exists(int b, int bCallExprBase, int n, int nGenericArgList, int nNameRef, int nReceiver | + b = 0 and + bCallExprBase = + b + 1 + max(int i | i = -1 or exists(getImmediateChildOfCallExprBase(e, i, _)) | i) and + n = bCallExprBase and + nGenericArgList = n + 1 and + nNameRef = nGenericArgList + 1 and + nReceiver = nNameRef + 1 and + ( + none() + or + result = getImmediateChildOfCallExprBase(e, index - b, partialPredicateCall) + or + index = n and result = e.getGenericArgList() and partialPredicateCall = "GenericArgList()" + or + index = nGenericArgList and result = e.getNameRef() and partialPredicateCall = "NameRef()" + or + index = nNameRef and result = e.getReceiver() and partialPredicateCall = "Receiver()" + ) + ) + } + private Element getImmediateChildOfModule(Module e, int index, string partialPredicateCall) { exists(int b, int bItem, int n, int nAttr, int nItemList, int nName, int nVisibility | b = 0 and @@ -3564,8 +3569,6 @@ private module Impl { or result = getImmediateChildOfBreakExpr(e, index, partialAccessor) or - result = getImmediateChildOfCallExpr(e, index, partialAccessor) - or result = getImmediateChildOfCastExpr(e, index, partialAccessor) or result = getImmediateChildOfClosureExpr(e, index, partialAccessor) @@ -3626,8 +3629,6 @@ private module Impl { or result = getImmediateChildOfMatchExpr(e, index, partialAccessor) or - result = getImmediateChildOfMethodCallExpr(e, index, partialAccessor) - or result = getImmediateChildOfNeverType(e, index, partialAccessor) or result = getImmediateChildOfOffsetOfExpr(e, index, partialAccessor) @@ -3700,6 +3701,8 @@ private module Impl { or result = getImmediateChildOfYieldExpr(e, index, partialAccessor) or + result = getImmediateChildOfCallExpr(e, index, partialAccessor) + or result = getImmediateChildOfConst(e, index, partialAccessor) or result = getImmediateChildOfEnum(e, index, partialAccessor) @@ -3718,6 +3721,8 @@ private module Impl { or result = getImmediateChildOfMacroRules(e, index, partialAccessor) or + result = getImmediateChildOfMethodCallExpr(e, index, partialAccessor) + or result = getImmediateChildOfModule(e, index, partialAccessor) or result = getImmediateChildOfStatic(e, index, partialAccessor) diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/PtrType.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/PtrType.qll index 47f438002db3..598052d09d5f 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/PtrType.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/PtrType.qll @@ -25,6 +25,16 @@ module Generated { class PtrType extends Synth::TPtrType, TypeRefImpl::TypeRef { override string getAPrimaryQlClass() { result = "PtrType" } + /** + * Holds if this ptr type is const. + */ + predicate isConst() { Synth::convertPtrTypeToRaw(this).(Raw::PtrType).isConst() } + + /** + * Holds if this ptr type is mut. + */ + predicate isMut() { Synth::convertPtrTypeToRaw(this).(Raw::PtrType).isMut() } + /** * Gets the ty of this ptr type, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll index 0a4506ab4b7d..032cb1e3d318 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll @@ -462,6 +462,11 @@ module Raw { */ Expr getExpr() { meta_exprs(this, result) } + /** + * Holds if this meta is unsafe. + */ + predicate isUnsafe() { meta_is_unsafe(this) } + /** * Gets the path of this meta, if it exists. */ @@ -813,6 +818,11 @@ module Raw { */ Attr getAttr(int index) { self_param_attrs(this, index, result) } + /** + * Holds if this self parameter is mut. + */ + predicate isMut() { self_param_is_mut(this) } + /** * Gets the lifetime of this self parameter, if it exists. */ @@ -940,6 +950,16 @@ module Raw { */ GenericParamList getGenericParamList() { type_bound_generic_param_lists(this, result) } + /** + * Holds if this type bound is async. + */ + predicate isAsync() { type_bound_is_async(this) } + + /** + * Holds if this type bound is const. + */ + predicate isConst() { type_bound_is_const(this) } + /** * Gets the lifetime of this type bound, if it exists. */ @@ -1361,6 +1381,36 @@ module Raw { */ Attr getAttr(int index) { block_expr_attrs(this, index, result) } + /** + * Holds if this block expression is async. + */ + predicate isAsync() { block_expr_is_async(this) } + + /** + * Holds if this block expression is const. + */ + predicate isConst() { block_expr_is_const(this) } + + /** + * Holds if this block expression is gen. + */ + predicate isGen() { block_expr_is_gen(this) } + + /** + * Holds if this block expression is move. + */ + predicate isMove() { block_expr_is_move(this) } + + /** + * Holds if this block expression is try. + */ + predicate isTry() { block_expr_is_try(this) } + + /** + * Holds if this block expression is unsafe. + */ + predicate isUnsafe() { block_expr_is_unsafe(this) } + /** * Gets the label of this block expression, if it exists. */ @@ -1438,31 +1488,18 @@ module Raw { /** * INTERNAL: Do not use. - * A function call expression. For example: - * ```rust - * foo(42); - * foo::(42); - * foo[0](42); - * foo(1) = 4; - * ``` + * A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. */ - class CallExpr extends @call_expr, Expr { - override string toString() { result = "CallExpr" } - + class CallExprBase extends @call_expr_base, Expr { /** - * Gets the argument list of this call expression, if it exists. + * Gets the argument list of this call expression base, if it exists. */ - ArgList getArgList() { call_expr_arg_lists(this, result) } + ArgList getArgList() { call_expr_base_arg_lists(this, result) } /** - * Gets the `index`th attr of this call expression (0-based). - */ - Attr getAttr(int index) { call_expr_attrs(this, index, result) } - - /** - * Gets the expression of this call expression, if it exists. + * Gets the `index`th attr of this call expression base (0-based). */ - Expr getExpr() { call_expr_exprs(this, result) } + Attr getAttr(int index) { call_expr_base_attrs(this, index, result) } } /** @@ -1522,6 +1559,31 @@ module Raw { */ ClosureBinder getClosureBinder() { closure_expr_closure_binders(this, result) } + /** + * Holds if this closure expression is async. + */ + predicate isAsync() { closure_expr_is_async(this) } + + /** + * Holds if this closure expression is const. + */ + predicate isConst() { closure_expr_is_const(this) } + + /** + * Holds if this closure expression is gen. + */ + predicate isGen() { closure_expr_is_gen(this) } + + /** + * Holds if this closure expression is move. + */ + predicate isMove() { closure_expr_is_move(this) } + + /** + * Holds if this closure expression is static. + */ + predicate isStatic() { closure_expr_is_static(this) } + /** * Gets the parameter list of this closure expression, if it exists. */ @@ -1588,6 +1650,11 @@ module Raw { * Gets the block expression of this const block pat, if it exists. */ BlockExpr getBlockExpr() { const_block_pat_block_exprs(this, result) } + + /** + * Holds if this const block pat is const. + */ + predicate isConst() { const_block_pat_is_const(this) } } /** @@ -1610,6 +1677,11 @@ module Raw { */ ConstArg getDefaultVal() { const_param_default_vals(this, result) } + /** + * Holds if this const parameter is const. + */ + predicate isConst() { const_param_is_const(this) } + /** * Gets the name of this const parameter, if it exists. */ @@ -1728,6 +1800,21 @@ module Raw { */ Abi getAbi() { fn_ptr_type_abis(this, result) } + /** + * Holds if this fn ptr type is async. + */ + predicate isAsync() { fn_ptr_type_is_async(this) } + + /** + * Holds if this fn ptr type is const. + */ + predicate isConst() { fn_ptr_type_is_const(this) } + + /** + * Holds if this fn ptr type is unsafe. + */ + predicate isUnsafe() { fn_ptr_type_is_unsafe(this) } + /** * Gets the parameter list of this fn ptr type, if it exists. */ @@ -1846,6 +1933,16 @@ module Raw { */ Attr getAttr(int index) { ident_pat_attrs(this, index, result) } + /** + * Holds if this ident pat is mut. + */ + predicate isMut() { ident_pat_is_mut(this) } + + /** + * Holds if this ident pat is reference. + */ + predicate isRef() { ident_pat_is_ref(this) } + /** * Gets the name of this ident pat, if it exists. */ @@ -2247,43 +2344,6 @@ module Raw { MatchArmList getMatchArmList() { match_expr_match_arm_lists(this, result) } } - /** - * INTERNAL: Do not use. - * A method call expression. For example: - * ```rust - * x.foo(42); - * x.foo::(42); - * ``` - */ - class MethodCallExpr extends @method_call_expr, Expr { - override string toString() { result = "MethodCallExpr" } - - /** - * Gets the argument list of this method call expression, if it exists. - */ - ArgList getArgList() { method_call_expr_arg_lists(this, result) } - - /** - * Gets the `index`th attr of this method call expression (0-based). - */ - Attr getAttr(int index) { method_call_expr_attrs(this, index, result) } - - /** - * Gets the generic argument list of this method call expression, if it exists. - */ - GenericArgList getGenericArgList() { method_call_expr_generic_arg_lists(this, result) } - - /** - * Gets the name reference of this method call expression, if it exists. - */ - NameRef getNameRef() { method_call_expr_name_refs(this, result) } - - /** - * Gets the receiver of this method call expression, if it exists. - */ - Expr getReceiver() { method_call_expr_receivers(this, result) } - } - /** * INTERNAL: Do not use. * A NeverType. For example: @@ -2489,6 +2549,16 @@ module Raw { class PtrType extends @ptr_type, TypeRef { override string toString() { result = "PtrType" } + /** + * Holds if this ptr type is const. + */ + predicate isConst() { ptr_type_is_const(this) } + + /** + * Holds if this ptr type is mut. + */ + predicate isMut() { ptr_type_is_mut(this) } + /** * Gets the ty of this ptr type, if it exists. */ @@ -2649,6 +2719,21 @@ module Raw { * Gets the expression of this reference expression, if it exists. */ Expr getExpr() { ref_expr_exprs(this, result) } + + /** + * Holds if this reference expression is const. + */ + predicate isConst() { ref_expr_is_const(this) } + + /** + * Holds if this reference expression is mut. + */ + predicate isMut() { ref_expr_is_mut(this) } + + /** + * Holds if this reference expression is raw. + */ + predicate isRaw() { ref_expr_is_raw(this) } } /** @@ -2664,6 +2749,11 @@ module Raw { class RefPat extends @ref_pat, Pat { override string toString() { result = "RefPat" } + /** + * Holds if this reference pat is mut. + */ + predicate isMut() { ref_pat_is_mut(this) } + /** * Gets the pat of this reference pat, if it exists. */ @@ -2680,6 +2770,11 @@ module Raw { class RefType extends @ref_type, TypeRef { override string toString() { result = "RefType" } + /** + * Holds if this reference type is mut. + */ + predicate isMut() { ref_type_is_mut(this) } + /** * Gets the lifetime of this reference type, if it exists. */ @@ -3040,6 +3135,25 @@ module Raw { Expr getExpr() { yield_expr_exprs(this, result) } } + /** + * INTERNAL: Do not use. + * A function call expression. For example: + * ```rust + * foo(42); + * foo::(42); + * foo[0](42); + * foo(1) = 4; + * ``` + */ + class CallExpr extends @call_expr, CallExprBase { + override string toString() { result = "CallExpr" } + + /** + * Gets the expression of this call expression, if it exists. + */ + Expr getExpr() { call_expr_exprs(this, result) } + } + /** * INTERNAL: Do not use. * A Const. For example: @@ -3060,6 +3174,16 @@ module Raw { */ Expr getBody() { const_bodies(this, result) } + /** + * Holds if this const is const. + */ + predicate isConst() { const_is_const(this) } + + /** + * Holds if this const is default. + */ + predicate isDefault() { const_is_default(this) } + /** * Gets the name of this const, if it exists. */ @@ -3141,6 +3265,11 @@ module Raw { * Gets the extern item list of this extern block, if it exists. */ ExternItemList getExternItemList() { extern_block_extern_item_lists(this, result) } + + /** + * Holds if this extern block is unsafe. + */ + predicate isUnsafe() { extern_block_is_unsafe(this) } } /** @@ -3210,6 +3339,31 @@ module Raw { */ GenericParamList getGenericParamList() { function_generic_param_lists(this, result) } + /** + * Holds if this function is async. + */ + predicate isAsync() { function_is_async(this) } + + /** + * Holds if this function is const. + */ + predicate isConst() { function_is_const(this) } + + /** + * Holds if this function is default. + */ + predicate isDefault() { function_is_default(this) } + + /** + * Holds if this function is gen. + */ + predicate isGen() { function_is_gen(this) } + + /** + * Holds if this function is unsafe. + */ + predicate isUnsafe() { function_is_unsafe(this) } + /** * Gets the name of this function, if it exists. */ @@ -3261,6 +3415,21 @@ module Raw { */ GenericParamList getGenericParamList() { impl_generic_param_lists(this, result) } + /** + * Holds if this impl is const. + */ + predicate isConst() { impl_is_const(this) } + + /** + * Holds if this impl is default. + */ + predicate isDefault() { impl_is_default(this) } + + /** + * Holds if this impl is unsafe. + */ + predicate isUnsafe() { impl_is_unsafe(this) } + /** * Gets the self ty of this impl, if it exists. */ @@ -3380,6 +3549,33 @@ module Raw { Visibility getVisibility() { macro_rules_visibilities(this, result) } } + /** + * INTERNAL: Do not use. + * A method call expression. For example: + * ```rust + * x.foo(42); + * x.foo::(42); + * ``` + */ + class MethodCallExpr extends @method_call_expr, CallExprBase { + override string toString() { result = "MethodCallExpr" } + + /** + * Gets the generic argument list of this method call expression, if it exists. + */ + GenericArgList getGenericArgList() { method_call_expr_generic_arg_lists(this, result) } + + /** + * Gets the name reference of this method call expression, if it exists. + */ + NameRef getNameRef() { method_call_expr_name_refs(this, result) } + + /** + * Gets the receiver of this method call expression, if it exists. + */ + Expr getReceiver() { method_call_expr_receivers(this, result) } + } + /** * INTERNAL: Do not use. * A module declaration. For example: @@ -3436,6 +3632,16 @@ module Raw { */ Expr getBody() { static_bodies(this, result) } + /** + * Holds if this static is mut. + */ + predicate isMut() { static_is_mut(this) } + + /** + * Holds if this static is static. + */ + predicate isStatic() { static_is_static(this) } + /** * Gets the name of this static, if it exists. */ @@ -3518,6 +3724,16 @@ module Raw { */ GenericParamList getGenericParamList() { trait_generic_param_lists(this, result) } + /** + * Holds if this trait is auto. + */ + predicate isAuto() { trait_is_auto(this) } + + /** + * Holds if this trait is unsafe. + */ + predicate isUnsafe() { trait_is_unsafe(this) } + /** * Gets the name of this trait, if it exists. */ @@ -3600,6 +3816,11 @@ module Raw { */ GenericParamList getGenericParamList() { type_alias_generic_param_lists(this, result) } + /** + * Holds if this type alias is default. + */ + predicate isDefault() { type_alias_is_default(this) } + /** * Gets the name of this type alias, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/RefExpr.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/RefExpr.qll index 90572fcf99ee..4eef67e3ed17 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/RefExpr.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/RefExpr.qll @@ -58,5 +58,20 @@ module Generated { * Holds if `getExpr()` exists. */ final predicate hasExpr() { exists(this.getExpr()) } + + /** + * Holds if this reference expression is const. + */ + predicate isConst() { Synth::convertRefExprToRaw(this).(Raw::RefExpr).isConst() } + + /** + * Holds if this reference expression is mut. + */ + predicate isMut() { Synth::convertRefExprToRaw(this).(Raw::RefExpr).isMut() } + + /** + * Holds if this reference expression is raw. + */ + predicate isRaw() { Synth::convertRefExprToRaw(this).(Raw::RefExpr).isRaw() } } } diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/RefPat.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/RefPat.qll index c16c87405c20..197030ea1cbf 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/RefPat.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/RefPat.qll @@ -28,6 +28,11 @@ module Generated { class RefPat extends Synth::TRefPat, PatImpl::Pat { override string getAPrimaryQlClass() { result = "RefPat" } + /** + * Holds if this reference pat is mut. + */ + predicate isMut() { Synth::convertRefPatToRaw(this).(Raw::RefPat).isMut() } + /** * Gets the pat of this reference pat, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/RefType.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/RefType.qll index 2d3df19798c1..ce0bbf1e416e 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/RefType.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/RefType.qll @@ -26,6 +26,11 @@ module Generated { class RefType extends Synth::TRefType, TypeRefImpl::TypeRef { override string getAPrimaryQlClass() { result = "RefType" } + /** + * Holds if this reference type is mut. + */ + predicate isMut() { Synth::convertRefTypeToRaw(this).(Raw::RefType).isMut() } + /** * Gets the lifetime of this reference type, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/SelfParam.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/SelfParam.qll index 24bf5433361f..243d04e9bb77 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/SelfParam.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/SelfParam.qll @@ -46,6 +46,11 @@ module Generated { */ final int getNumberOfAttrs() { result = count(int i | exists(this.getAttr(i))) } + /** + * Holds if this self parameter is mut. + */ + predicate isMut() { Synth::convertSelfParamToRaw(this).(Raw::SelfParam).isMut() } + /** * Gets the lifetime of this self parameter, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Static.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Static.qll index 6fbe692fb28d..a7d5828ee980 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Static.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Static.qll @@ -60,6 +60,16 @@ module Generated { */ final predicate hasBody() { exists(this.getBody()) } + /** + * Holds if this static is mut. + */ + predicate isMut() { Synth::convertStaticToRaw(this).(Raw::Static).isMut() } + + /** + * Holds if this static is static. + */ + predicate isStatic() { Synth::convertStaticToRaw(this).(Raw::Static).isStatic() } + /** * Gets the name of this static, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll index 53fa252f306d..a6b0bd82c621 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll @@ -611,16 +611,21 @@ module Synth { TTypeBoundList or TTypeRef or TUseTree or TUseTreeList or TVariant or TVariantList or TVisibility or TWhereClause or TWherePred; + /** + * INTERNAL: Do not use. + */ + class TCallExprBase = TCallExpr or TMethodCallExpr; + /** * INTERNAL: Do not use. */ class TExpr = TArrayExpr or TAsmExpr or TAwaitExpr or TBecomeExpr or TBinaryExpr or TBlockExpr or - TBreakExpr or TCallExpr or TCastExpr or TClosureExpr or TContinueExpr or TFieldExpr or + TBreakExpr or TCallExprBase or TCastExpr or TClosureExpr or TContinueExpr or TFieldExpr or TForExpr or TFormatArgsExpr or TIfExpr or TIndexExpr or TLetExpr or TLiteralExpr or - TLoopExpr or TMacroExpr or TMatchExpr or TMethodCallExpr or TOffsetOfExpr or TParenExpr or - TPathExpr or TPrefixExpr or TRangeExpr or TRecordExpr or TRefExpr or TReturnExpr or - TTryExpr or TTupleExpr or TUnderscoreExpr or TWhileExpr or TYeetExpr or TYieldExpr; + TLoopExpr or TMacroExpr or TMatchExpr or TOffsetOfExpr or TParenExpr or TPathExpr or + TPrefixExpr or TRangeExpr or TRecordExpr or TRefExpr or TReturnExpr or TTryExpr or + TTupleExpr or TUnderscoreExpr or TWhileExpr or TYeetExpr or TYieldExpr; /** * INTERNAL: Do not use. @@ -1688,6 +1693,16 @@ module Synth { result = convertWherePredFromRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a raw DB element to a synthesized `TCallExprBase`, if possible. + */ + TCallExprBase convertCallExprBaseFromRaw(Raw::Element e) { + result = convertCallExprFromRaw(e) + or + result = convertMethodCallExprFromRaw(e) + } + /** * INTERNAL: Do not use. * Converts a raw DB element to a synthesized `TElement`, if possible. @@ -1717,7 +1732,7 @@ module Synth { or result = convertBreakExprFromRaw(e) or - result = convertCallExprFromRaw(e) + result = convertCallExprBaseFromRaw(e) or result = convertCastExprFromRaw(e) or @@ -1745,8 +1760,6 @@ module Synth { or result = convertMatchExprFromRaw(e) or - result = convertMethodCallExprFromRaw(e) - or result = convertOffsetOfExprFromRaw(e) or result = convertParenExprFromRaw(e) @@ -2974,6 +2987,16 @@ module Synth { result = convertWherePredToRaw(e) } + /** + * INTERNAL: Do not use. + * Converts a synthesized `TCallExprBase` to a raw DB element, if possible. + */ + Raw::Element convertCallExprBaseToRaw(TCallExprBase e) { + result = convertCallExprToRaw(e) + or + result = convertMethodCallExprToRaw(e) + } + /** * INTERNAL: Do not use. * Converts a synthesized `TElement` to a raw DB element, if possible. @@ -3003,7 +3026,7 @@ module Synth { or result = convertBreakExprToRaw(e) or - result = convertCallExprToRaw(e) + result = convertCallExprBaseToRaw(e) or result = convertCastExprToRaw(e) or @@ -3031,8 +3054,6 @@ module Synth { or result = convertMatchExprToRaw(e) or - result = convertMethodCallExprToRaw(e) - or result = convertOffsetOfExprToRaw(e) or result = convertParenExprToRaw(e) diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/Trait.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/Trait.qll index 88cea87c5b5a..acbcb1e2e24b 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/Trait.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/Trait.qll @@ -78,6 +78,16 @@ module Generated { */ final predicate hasGenericParamList() { exists(this.getGenericParamList()) } + /** + * Holds if this trait is auto. + */ + predicate isAuto() { Synth::convertTraitToRaw(this).(Raw::Trait).isAuto() } + + /** + * Holds if this trait is unsafe. + */ + predicate isUnsafe() { Synth::convertTraitToRaw(this).(Raw::Trait).isUnsafe() } + /** * Gets the name of this trait, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/TypeAlias.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/TypeAlias.qll index 1014900cb0a6..2f5294ef65e8 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/TypeAlias.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/TypeAlias.qll @@ -68,6 +68,11 @@ module Generated { */ final predicate hasGenericParamList() { exists(this.getGenericParamList()) } + /** + * Holds if this type alias is default. + */ + predicate isDefault() { Synth::convertTypeAliasToRaw(this).(Raw::TypeAlias).isDefault() } + /** * Gets the name of this type alias, if it exists. */ diff --git a/rust/ql/lib/codeql/rust/elements/internal/generated/TypeBound.qll b/rust/ql/lib/codeql/rust/elements/internal/generated/TypeBound.qll index 4a571897ba71..e83586d9cdf9 100644 --- a/rust/ql/lib/codeql/rust/elements/internal/generated/TypeBound.qll +++ b/rust/ql/lib/codeql/rust/elements/internal/generated/TypeBound.qll @@ -42,6 +42,16 @@ module Generated { */ final predicate hasGenericParamList() { exists(this.getGenericParamList()) } + /** + * Holds if this type bound is async. + */ + predicate isAsync() { Synth::convertTypeBoundToRaw(this).(Raw::TypeBound).isAsync() } + + /** + * Holds if this type bound is const. + */ + predicate isConst() { Synth::convertTypeBoundToRaw(this).(Raw::TypeBound).isConst() } + /** * Gets the lifetime of this type bound, if it exists. */ diff --git a/rust/ql/lib/rust.dbscheme b/rust/ql/lib/rust.dbscheme index ab7460435995..d5037a496aa1 100644 --- a/rust/ql/lib/rust.dbscheme +++ b/rust/ql/lib/rust.dbscheme @@ -275,7 +275,7 @@ closure_binder_generic_param_lists( | @binary_expr | @block_expr | @break_expr -| @call_expr +| @call_expr_base | @cast_expr | @closure_expr | @continue_expr @@ -289,7 +289,6 @@ closure_binder_generic_param_lists( | @loop_expr | @macro_expr | @match_expr -| @method_call_expr | @offset_of_expr | @paren_expr | @path_expr @@ -530,6 +529,11 @@ meta_exprs( int expr: @expr ref ); +#keyset[id] +meta_is_unsafe( + int id: @meta ref +); + #keyset[id] meta_paths( int id: @meta ref, @@ -834,6 +838,11 @@ self_param_attrs( int attr: @attr ref ); +#keyset[id] +self_param_is_mut( + int id: @self_param ref +); + #keyset[id] self_param_lifetimes( int id: @self_param ref, @@ -941,6 +950,16 @@ type_bound_generic_param_lists( int generic_param_list: @generic_param_list ref ); +#keyset[id] +type_bound_is_async( + int id: @type_bound ref +); + +#keyset[id] +type_bound_is_const( + int id: @type_bound ref +); + #keyset[id] type_bound_lifetimes( int id: @type_bound ref, @@ -1286,6 +1305,36 @@ block_expr_attrs( int attr: @attr ref ); +#keyset[id] +block_expr_is_async( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_const( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_gen( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_move( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_try( + int id: @block_expr ref +); + +#keyset[id] +block_expr_is_unsafe( + int id: @block_expr ref +); + #keyset[id] block_expr_labels( int id: @block_expr ref, @@ -1331,29 +1380,24 @@ break_expr_lifetimes( int lifetime: @lifetime ref ); -call_exprs( - unique int id: @call_expr -); +@call_expr_base = + @call_expr +| @method_call_expr +; #keyset[id] -call_expr_arg_lists( - int id: @call_expr ref, +call_expr_base_arg_lists( + int id: @call_expr_base ref, int arg_list: @arg_list ref ); #keyset[id, index] -call_expr_attrs( - int id: @call_expr ref, +call_expr_base_attrs( + int id: @call_expr_base ref, int index: int ref, int attr: @attr ref ); -#keyset[id] -call_expr_exprs( - int id: @call_expr ref, - int expr: @expr ref -); - cast_exprs( unique int id: @cast_expr ); @@ -1400,6 +1444,31 @@ closure_expr_closure_binders( int closure_binder: @closure_binder ref ); +#keyset[id] +closure_expr_is_async( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_const( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_gen( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_move( + int id: @closure_expr ref +); + +#keyset[id] +closure_expr_is_static( + int id: @closure_expr ref +); + #keyset[id] closure_expr_param_lists( int id: @closure_expr ref, @@ -1438,6 +1507,11 @@ const_block_pat_block_exprs( int block_expr: @block_expr ref ); +#keyset[id] +const_block_pat_is_const( + int id: @const_block_pat ref +); + const_params( unique int id: @const_param ); @@ -1455,6 +1529,11 @@ const_param_default_vals( int default_val: @const_arg ref ); +#keyset[id] +const_param_is_const( + int id: @const_param ref +); + #keyset[id] const_param_names( int id: @const_param ref, @@ -1537,6 +1616,21 @@ fn_ptr_type_abis( int abi: @abi ref ); +#keyset[id] +fn_ptr_type_is_async( + int id: @fn_ptr_type ref +); + +#keyset[id] +fn_ptr_type_is_const( + int id: @fn_ptr_type ref +); + +#keyset[id] +fn_ptr_type_is_unsafe( + int id: @fn_ptr_type ref +); + #keyset[id] fn_ptr_type_param_lists( int id: @fn_ptr_type ref, @@ -1635,6 +1729,16 @@ ident_pat_attrs( int attr: @attr ref ); +#keyset[id] +ident_pat_is_mut( + int id: @ident_pat ref +); + +#keyset[id] +ident_pat_is_ref( + int id: @ident_pat ref +); + #keyset[id] ident_pat_names( int id: @ident_pat ref, @@ -1927,41 +2031,6 @@ match_expr_match_arm_lists( int match_arm_list: @match_arm_list ref ); -method_call_exprs( - unique int id: @method_call_expr -); - -#keyset[id] -method_call_expr_arg_lists( - int id: @method_call_expr ref, - int arg_list: @arg_list ref -); - -#keyset[id, index] -method_call_expr_attrs( - int id: @method_call_expr ref, - int index: int ref, - int attr: @attr ref -); - -#keyset[id] -method_call_expr_generic_arg_lists( - int id: @method_call_expr ref, - int generic_arg_list: @generic_arg_list ref -); - -#keyset[id] -method_call_expr_name_refs( - int id: @method_call_expr ref, - int name_ref: @name_ref ref -); - -#keyset[id] -method_call_expr_receivers( - int id: @method_call_expr ref, - int receiver: @expr ref -); - never_types( unique int id: @never_type ); @@ -2102,6 +2171,16 @@ ptr_types( unique int id: @ptr_type ); +#keyset[id] +ptr_type_is_const( + int id: @ptr_type ref +); + +#keyset[id] +ptr_type_is_mut( + int id: @ptr_type ref +); + #keyset[id] ptr_type_ties( int id: @ptr_type ref, @@ -2219,10 +2298,30 @@ ref_expr_exprs( int expr: @expr ref ); +#keyset[id] +ref_expr_is_const( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_mut( + int id: @ref_expr ref +); + +#keyset[id] +ref_expr_is_raw( + int id: @ref_expr ref +); + ref_pats( unique int id: @ref_pat ); +#keyset[id] +ref_pat_is_mut( + int id: @ref_pat ref +); + #keyset[id] ref_pat_pats( int id: @ref_pat ref, @@ -2233,6 +2332,11 @@ ref_types( unique int id: @ref_type ); +#keyset[id] +ref_type_is_mut( + int id: @ref_type ref +); + #keyset[id] ref_type_lifetimes( int id: @ref_type ref, @@ -2496,6 +2600,16 @@ yield_expr_exprs( int expr: @expr ref ); +call_exprs( + unique int id: @call_expr +); + +#keyset[id] +call_expr_exprs( + int id: @call_expr ref, + int expr: @expr ref +); + consts( unique int id: @const ); @@ -2513,6 +2627,16 @@ const_bodies( int body: @expr ref ); +#keyset[id] +const_is_const( + int id: @const ref +); + +#keyset[id] +const_is_default( + int id: @const ref +); + #keyset[id] const_names( int id: @const ref, @@ -2595,6 +2719,11 @@ extern_block_extern_item_lists( int extern_item_list: @extern_item_list ref ); +#keyset[id] +extern_block_is_unsafe( + int id: @extern_block ref +); + extern_crates( unique int id: @extern_crate ); @@ -2653,6 +2782,31 @@ function_generic_param_lists( int generic_param_list: @generic_param_list ref ); +#keyset[id] +function_is_async( + int id: @function ref +); + +#keyset[id] +function_is_const( + int id: @function ref +); + +#keyset[id] +function_is_default( + int id: @function ref +); + +#keyset[id] +function_is_gen( + int id: @function ref +); + +#keyset[id] +function_is_unsafe( + int id: @function ref +); + #keyset[id] function_names( int id: @function ref, @@ -2706,6 +2860,21 @@ impl_generic_param_lists( int generic_param_list: @generic_param_list ref ); +#keyset[id] +impl_is_const( + int id: @impl ref +); + +#keyset[id] +impl_is_default( + int id: @impl ref +); + +#keyset[id] +impl_is_unsafe( + int id: @impl ref +); + #keyset[id] impl_self_ties( int id: @impl ref, @@ -2823,6 +2992,28 @@ macro_rules_visibilities( int visibility: @visibility ref ); +method_call_exprs( + unique int id: @method_call_expr +); + +#keyset[id] +method_call_expr_generic_arg_lists( + int id: @method_call_expr ref, + int generic_arg_list: @generic_arg_list ref +); + +#keyset[id] +method_call_expr_name_refs( + int id: @method_call_expr ref, + int name_ref: @name_ref ref +); + +#keyset[id] +method_call_expr_receivers( + int id: @method_call_expr ref, + int receiver: @expr ref +); + modules( unique int id: @module ); @@ -2869,6 +3060,16 @@ static_bodies( int body: @expr ref ); +#keyset[id] +static_is_mut( + int id: @static ref +); + +#keyset[id] +static_is_static( + int id: @static ref +); + #keyset[id] static_names( int id: @static ref, @@ -2951,6 +3152,16 @@ trait_generic_param_lists( int generic_param_list: @generic_param_list ref ); +#keyset[id] +trait_is_auto( + int id: @trait ref +); + +#keyset[id] +trait_is_unsafe( + int id: @trait ref +); + #keyset[id] trait_names( int id: @trait ref, @@ -3033,6 +3244,11 @@ type_alias_generic_param_lists( int generic_param_list: @generic_param_list ref ); +#keyset[id] +type_alias_is_default( + int id: @type_alias ref +); + #keyset[id] type_alias_names( int id: @type_alias ref, diff --git a/rust/ql/src/queries/diagnostics/ExtractionErrors.ql b/rust/ql/src/queries/diagnostics/ExtractionErrors.ql index a04c4e618c41..68be66f8ca9b 100644 --- a/rust/ql/src/queries/diagnostics/ExtractionErrors.ql +++ b/rust/ql/src/queries/diagnostics/ExtractionErrors.ql @@ -8,7 +8,7 @@ import codeql.rust.Diagnostics import codeql.files.FileSystem -/** Gets the SARIF severity to associate an error. */ +/** Gets the SARIF severity to associate with an error. */ int getSeverity() { result = 2 } from ExtractionError error, File f diff --git a/rust/ql/src/queries/diagnostics/ExtractionWarnings.ql b/rust/ql/src/queries/diagnostics/ExtractionWarnings.ql new file mode 100644 index 000000000000..99773cc6d53a --- /dev/null +++ b/rust/ql/src/queries/diagnostics/ExtractionWarnings.ql @@ -0,0 +1,19 @@ +/** + * @name Extraction warnings + * @description List all extraction warnings for files in the source code directory. + * @kind diagnostic + * @id rust/diagnostics/extraction-warnings + */ + +import codeql.rust.Diagnostics +import codeql.files.FileSystem + +/** Gets the SARIF severity to associate with a warning. */ +int getSeverity() { result = 1 } + +from ExtractionWarning warning, File f +where + f = warning.getLocation().getFile() and + exists(f.getRelativePath()) +select warning, "Extraction warning in " + f + " with message " + warning.getMessage(), + getSeverity() diff --git a/rust/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql b/rust/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql index 1af3f0f88ec0..23db30f53e96 100644 --- a/rust/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql +++ b/rust/ql/src/queries/summary/NumberOfFilesExtractedWithErrors.ql @@ -2,14 +2,15 @@ * @id rust/summary/number-of-files-extracted-with-errors * @name Total number of Rust files that were extracted with errors * @description The total number of Rust files in the source code directory that - * were extracted, but where at least one extraction error occurred in the process. + * were extracted, but where at least one extraction error (or warning) occurred + * in the process. * @kind metric * @tags summary */ import codeql.files.FileSystem -import codeql.rust.Diagnostics select count(File f | - exists(ExtractionError e | e.getLocation().getFile() = f) and exists(f.getRelativePath()) + exists(f.getRelativePath()) and + not f instanceof SuccessfullyExtractedFile ) diff --git a/rust/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql b/rust/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql index eb86577b4b80..c960599ad18f 100644 --- a/rust/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql +++ b/rust/ql/src/queries/summary/NumberOfSuccessfullyExtractedFiles.ql @@ -2,14 +2,11 @@ * @id rust/summary/number-of-successfully-extracted-files * @name Total number of Rust files that were extracted without error * @description The total number of Rust files in the source code directory that - * were extracted without encountering any extraction errors. + * were extracted without encountering any extraction errors (or warnings). * @kind metric * @tags summary */ -import codeql.rust.Diagnostics import codeql.files.FileSystem -select count(File f | - not exists(ExtractionError e | e.getLocation().getFile() = f) and exists(f.getRelativePath()) - ) +select count(SuccessfullyExtractedFile f | exists(f.getRelativePath())) diff --git a/rust/ql/src/queries/summary/SummaryStats.ql b/rust/ql/src/queries/summary/SummaryStats.ql index 447325514cac..a3494ccb769c 100644 --- a/rust/ql/src/queries/summary/SummaryStats.ql +++ b/rust/ql/src/queries/summary/SummaryStats.ql @@ -7,16 +7,29 @@ */ import rust +import codeql.rust.Diagnostics import Stats from string key, string value where - key = "Files extracted" and value = count(File f | exists(f.getRelativePath())).toString() - or key = "Elements extracted" and value = count(Element e | not e instanceof Unextracted).toString() or key = "Elements unextracted" and value = count(Unextracted e).toString() or + key = "Extraction errors" and value = count(ExtractionError e).toString() + or + key = "Extraction warnings" and value = count(ExtractionWarning w).toString() + or + key = "Files extracted - total" and value = count(File f | exists(f.getRelativePath())).toString() + or + key = "Files extracted - with errors" and + value = + count(File f | exists(f.getRelativePath()) and not f instanceof SuccessfullyExtractedFile) + .toString() + or + key = "Files extracted - without errors" and + value = count(SuccessfullyExtractedFile f | exists(f.getRelativePath())).toString() + or key = "Lines of code extracted" and value = getLinesOfCode().toString() or key = "Lines of user code extracted" and value = getLinesOfUserCode().toString() diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.expected b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.expected index 6308944a23e8..39ec1d6a7e1a 100644 --- a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.expected +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.expected @@ -1,3 +1,3 @@ -| gen_block_expr.rs:3:28:12:1 | BlockExpr | getNumberOfAttrs: | 0 | hasLabel: | no | hasStmtList: | yes | -| gen_block_expr.rs:5:5:7:5 | BlockExpr | getNumberOfAttrs: | 0 | hasLabel: | no | hasStmtList: | yes | -| gen_block_expr.rs:8:5:11:5 | BlockExpr | getNumberOfAttrs: | 0 | hasLabel: | yes | hasStmtList: | yes | +| gen_block_expr.rs:3:28:12:1 | BlockExpr | getNumberOfAttrs: | 0 | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isTry: | no | isUnsafe: | no | hasLabel: | no | hasStmtList: | yes | +| gen_block_expr.rs:5:5:7:5 | BlockExpr | getNumberOfAttrs: | 0 | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isTry: | no | isUnsafe: | no | hasLabel: | no | hasStmtList: | yes | +| gen_block_expr.rs:8:5:11:5 | BlockExpr | getNumberOfAttrs: | 0 | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isTry: | no | isUnsafe: | no | hasLabel: | yes | hasStmtList: | yes | diff --git a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql index 7748f7d14135..581070545155 100644 --- a/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql +++ b/rust/ql/test/extractor-tests/generated/BlockExpr/BlockExpr.ql @@ -2,11 +2,21 @@ import codeql.rust.elements import TestUtils -from BlockExpr x, int getNumberOfAttrs, string hasLabel, string hasStmtList +from + BlockExpr x, int getNumberOfAttrs, string isAsync, string isConst, string isGen, string isMove, + string isTry, string isUnsafe, string hasLabel, string hasStmtList where toBeTested(x) and not x.isUnknown() and getNumberOfAttrs = x.getNumberOfAttrs() and + (if x.isAsync() then isAsync = "yes" else isAsync = "no") and + (if x.isConst() then isConst = "yes" else isConst = "no") and + (if x.isGen() then isGen = "yes" else isGen = "no") and + (if x.isMove() then isMove = "yes" else isMove = "no") and + (if x.isTry() then isTry = "yes" else isTry = "no") and + (if x.isUnsafe() then isUnsafe = "yes" else isUnsafe = "no") and (if x.hasLabel() then hasLabel = "yes" else hasLabel = "no") and if x.hasStmtList() then hasStmtList = "yes" else hasStmtList = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasLabel:", hasLabel, "hasStmtList:", hasStmtList +select x, "getNumberOfAttrs:", getNumberOfAttrs, "isAsync:", isAsync, "isConst:", isConst, "isGen:", + isGen, "isMove:", isMove, "isTry:", isTry, "isUnsafe:", isUnsafe, "hasLabel:", hasLabel, + "hasStmtList:", hasStmtList diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.expected b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.expected index c6a8ba5ece4b..18fb82716295 100644 --- a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.expected +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.expected @@ -1,5 +1,5 @@ -| gen_closure_expr.rs:5:5:5:13 | ClosureExpr | getNumberOfAttrs: | 0 | hasBody: | yes | hasClosureBinder: | no | hasParamList: | yes | hasRetType: | no | -| gen_closure_expr.rs:6:5:6:34 | ClosureExpr | getNumberOfAttrs: | 0 | hasBody: | yes | hasClosureBinder: | no | hasParamList: | yes | hasRetType: | yes | -| gen_closure_expr.rs:7:5:7:27 | ClosureExpr | getNumberOfAttrs: | 0 | hasBody: | yes | hasClosureBinder: | no | hasParamList: | yes | hasRetType: | no | -| gen_closure_expr.rs:8:6:9:15 | ClosureExpr | getNumberOfAttrs: | 1 | hasBody: | yes | hasClosureBinder: | no | hasParamList: | yes | hasRetType: | no | -| gen_closure_expr.rs:10:6:11:23 | ClosureExpr | getNumberOfAttrs: | 1 | hasBody: | yes | hasClosureBinder: | no | hasParamList: | yes | hasRetType: | no | +| gen_closure_expr.rs:5:5:5:13 | ClosureExpr | getNumberOfAttrs: | 0 | hasBody: | yes | hasClosureBinder: | no | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isStatic: | no | hasParamList: | yes | hasRetType: | no | +| gen_closure_expr.rs:6:5:6:34 | ClosureExpr | getNumberOfAttrs: | 0 | hasBody: | yes | hasClosureBinder: | no | isAsync: | no | isConst: | no | isGen: | no | isMove: | yes | isStatic: | no | hasParamList: | yes | hasRetType: | yes | +| gen_closure_expr.rs:7:5:7:27 | ClosureExpr | getNumberOfAttrs: | 0 | hasBody: | yes | hasClosureBinder: | no | isAsync: | yes | isConst: | no | isGen: | no | isMove: | no | isStatic: | no | hasParamList: | yes | hasRetType: | no | +| gen_closure_expr.rs:8:6:9:15 | ClosureExpr | getNumberOfAttrs: | 1 | hasBody: | yes | hasClosureBinder: | no | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isStatic: | no | hasParamList: | yes | hasRetType: | no | +| gen_closure_expr.rs:10:6:11:23 | ClosureExpr | getNumberOfAttrs: | 1 | hasBody: | yes | hasClosureBinder: | no | isAsync: | no | isConst: | no | isGen: | no | isMove: | no | isStatic: | yes | hasParamList: | yes | hasRetType: | no | diff --git a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.ql b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.ql index 5fabed2d7da4..f55b0c78d22a 100644 --- a/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.ql +++ b/rust/ql/test/extractor-tests/generated/ClosureExpr/ClosureExpr.ql @@ -3,7 +3,8 @@ import codeql.rust.elements import TestUtils from - ClosureExpr x, int getNumberOfAttrs, string hasBody, string hasClosureBinder, string hasParamList, + ClosureExpr x, int getNumberOfAttrs, string hasBody, string hasClosureBinder, string isAsync, + string isConst, string isGen, string isMove, string isStatic, string hasParamList, string hasRetType where toBeTested(x) and @@ -11,7 +12,13 @@ where getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasBody() then hasBody = "yes" else hasBody = "no") and (if x.hasClosureBinder() then hasClosureBinder = "yes" else hasClosureBinder = "no") and + (if x.isAsync() then isAsync = "yes" else isAsync = "no") and + (if x.isConst() then isConst = "yes" else isConst = "no") and + (if x.isGen() then isGen = "yes" else isGen = "no") and + (if x.isMove() then isMove = "yes" else isMove = "no") and + (if x.isStatic() then isStatic = "yes" else isStatic = "no") and (if x.hasParamList() then hasParamList = "yes" else hasParamList = "no") and if x.hasRetType() then hasRetType = "yes" else hasRetType = "no" select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasBody:", hasBody, "hasClosureBinder:", - hasClosureBinder, "hasParamList:", hasParamList, "hasRetType:", hasRetType + hasClosureBinder, "isAsync:", isAsync, "isConst:", isConst, "isGen:", isGen, "isMove:", isMove, + "isStatic:", isStatic, "hasParamList:", hasParamList, "hasRetType:", hasRetType diff --git a/rust/ql/test/extractor-tests/generated/Const/Const.ql b/rust/ql/test/extractor-tests/generated/Const/Const.ql index 9af69afe4d3b..a5def567f8c2 100644 --- a/rust/ql/test/extractor-tests/generated/Const/Const.ql +++ b/rust/ql/test/extractor-tests/generated/Const/Const.ql @@ -3,14 +3,17 @@ import codeql.rust.elements import TestUtils from - Const x, int getNumberOfAttrs, string hasBody, string hasName, string hasTy, string hasVisibility + Const x, int getNumberOfAttrs, string hasBody, string isConst, string isDefault, string hasName, + string hasTy, string hasVisibility where toBeTested(x) and not x.isUnknown() and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasBody() then hasBody = "yes" else hasBody = "no") and + (if x.isConst() then isConst = "yes" else isConst = "no") and + (if x.isDefault() then isDefault = "yes" else isDefault = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and (if x.hasTy() then hasTy = "yes" else hasTy = "no") and if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasBody:", hasBody, "hasName:", hasName, "hasTy:", - hasTy, "hasVisibility:", hasVisibility +select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasBody:", hasBody, "isConst:", isConst, + "isDefault:", isDefault, "hasName:", hasName, "hasTy:", hasTy, "hasVisibility:", hasVisibility diff --git a/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.expected b/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.expected index 5b6220f2b9c9..21feba1f729f 100644 --- a/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.expected +++ b/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.expected @@ -1 +1 @@ -| gen_const_block_pat.rs:6:9:6:27 | ConstBlockPat | hasBlockExpr: | yes | +| gen_const_block_pat.rs:6:9:6:27 | ConstBlockPat | hasBlockExpr: | yes | isConst: | yes | diff --git a/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.ql b/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.ql index 058f9bcae1d8..005f8a752c1f 100644 --- a/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.ql +++ b/rust/ql/test/extractor-tests/generated/ConstBlockPat/ConstBlockPat.ql @@ -2,9 +2,10 @@ import codeql.rust.elements import TestUtils -from ConstBlockPat x, string hasBlockExpr +from ConstBlockPat x, string hasBlockExpr, string isConst where toBeTested(x) and not x.isUnknown() and - if x.hasBlockExpr() then hasBlockExpr = "yes" else hasBlockExpr = "no" -select x, "hasBlockExpr:", hasBlockExpr + (if x.hasBlockExpr() then hasBlockExpr = "yes" else hasBlockExpr = "no") and + if x.isConst() then isConst = "yes" else isConst = "no" +select x, "hasBlockExpr:", hasBlockExpr, "isConst:", isConst diff --git a/rust/ql/test/extractor-tests/generated/ConstParam/ConstParam.ql b/rust/ql/test/extractor-tests/generated/ConstParam/ConstParam.ql index 2415e1728d9c..5988a54b4d1b 100644 --- a/rust/ql/test/extractor-tests/generated/ConstParam/ConstParam.ql +++ b/rust/ql/test/extractor-tests/generated/ConstParam/ConstParam.ql @@ -2,13 +2,16 @@ import codeql.rust.elements import TestUtils -from ConstParam x, int getNumberOfAttrs, string hasDefaultVal, string hasName, string hasTy +from + ConstParam x, int getNumberOfAttrs, string hasDefaultVal, string isConst, string hasName, + string hasTy where toBeTested(x) and not x.isUnknown() and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasDefaultVal() then hasDefaultVal = "yes" else hasDefaultVal = "no") and + (if x.isConst() then isConst = "yes" else isConst = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and if x.hasTy() then hasTy = "yes" else hasTy = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasDefaultVal:", hasDefaultVal, "hasName:", - hasName, "hasTy:", hasTy +select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasDefaultVal:", hasDefaultVal, "isConst:", + isConst, "hasName:", hasName, "hasTy:", hasTy diff --git a/rust/ql/test/extractor-tests/generated/ExternBlock/ExternBlock.ql b/rust/ql/test/extractor-tests/generated/ExternBlock/ExternBlock.ql index 8400769a595f..7348a546ec20 100644 --- a/rust/ql/test/extractor-tests/generated/ExternBlock/ExternBlock.ql +++ b/rust/ql/test/extractor-tests/generated/ExternBlock/ExternBlock.ql @@ -2,12 +2,13 @@ import codeql.rust.elements import TestUtils -from ExternBlock x, string hasAbi, int getNumberOfAttrs, string hasExternItemList +from ExternBlock x, string hasAbi, int getNumberOfAttrs, string hasExternItemList, string isUnsafe where toBeTested(x) and not x.isUnknown() and (if x.hasAbi() then hasAbi = "yes" else hasAbi = "no") and getNumberOfAttrs = x.getNumberOfAttrs() and - if x.hasExternItemList() then hasExternItemList = "yes" else hasExternItemList = "no" + (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 + hasExternItemList, "isUnsafe:", isUnsafe diff --git a/rust/ql/test/extractor-tests/generated/FnPtrType/FnPtrType.ql b/rust/ql/test/extractor-tests/generated/FnPtrType/FnPtrType.ql index b5b871c4f271..83cf90dec0a0 100644 --- a/rust/ql/test/extractor-tests/generated/FnPtrType/FnPtrType.ql +++ b/rust/ql/test/extractor-tests/generated/FnPtrType/FnPtrType.ql @@ -2,11 +2,17 @@ import codeql.rust.elements import TestUtils -from FnPtrType x, string hasAbi, string hasParamList, string hasRetType +from + FnPtrType x, string hasAbi, string isAsync, string isConst, string isUnsafe, string hasParamList, + string hasRetType where toBeTested(x) and not x.isUnknown() and (if x.hasAbi() then hasAbi = "yes" else hasAbi = "no") and + (if x.isAsync() then isAsync = "yes" else isAsync = "no") and + (if x.isConst() then isConst = "yes" else isConst = "no") and + (if x.isUnsafe() then isUnsafe = "yes" else isUnsafe = "no") and (if x.hasParamList() then hasParamList = "yes" else hasParamList = "no") and if x.hasRetType() then hasRetType = "yes" else hasRetType = "no" -select x, "hasAbi:", hasAbi, "hasParamList:", hasParamList, "hasRetType:", hasRetType +select x, "hasAbi:", hasAbi, "isAsync:", isAsync, "isConst:", isConst, "isUnsafe:", isUnsafe, + "hasParamList:", hasParamList, "hasRetType:", hasRetType diff --git a/rust/ql/test/extractor-tests/generated/Function/Function.expected b/rust/ql/test/extractor-tests/generated/Function/Function.expected index fd765f9b5785..cf2de6ac0a6d 100644 --- a/rust/ql/test/extractor-tests/generated/Function/Function.expected +++ b/rust/ql/test/extractor-tests/generated/Function/Function.expected @@ -1,2 +1,2 @@ -| gen_function.rs:3:1:4:38 | foo | hasAbi: | no | getNumberOfAttrs: | 0 | hasBody: | yes | hasGenericParamList: | no | hasName: | yes | hasParamList: | yes | hasRetType: | yes | hasVisibility: | no | hasWhereClause: | no | -| gen_function.rs:7:5:7:13 | bar | hasAbi: | no | getNumberOfAttrs: | 0 | hasBody: | no | hasGenericParamList: | no | hasName: | yes | hasParamList: | yes | hasRetType: | no | hasVisibility: | no | hasWhereClause: | no | +| gen_function.rs:3:1:4:38 | foo | hasAbi: | no | getNumberOfAttrs: | 0 | hasBody: | yes | hasGenericParamList: | no | isAsync: | no | isConst: | no | isDefault: | no | isGen: | no | isUnsafe: | no | hasName: | yes | hasParamList: | yes | hasRetType: | yes | hasVisibility: | no | hasWhereClause: | no | +| gen_function.rs:7:5:7:13 | bar | hasAbi: | no | getNumberOfAttrs: | 0 | hasBody: | no | hasGenericParamList: | no | isAsync: | no | isConst: | no | isDefault: | no | isGen: | no | isUnsafe: | no | hasName: | yes | hasParamList: | yes | hasRetType: | no | hasVisibility: | no | hasWhereClause: | no | diff --git a/rust/ql/test/extractor-tests/generated/Function/Function.ql b/rust/ql/test/extractor-tests/generated/Function/Function.ql index 2ab5bea652ac..9f4fed07e57d 100644 --- a/rust/ql/test/extractor-tests/generated/Function/Function.ql +++ b/rust/ql/test/extractor-tests/generated/Function/Function.ql @@ -4,8 +4,8 @@ import TestUtils from Function x, string hasAbi, int getNumberOfAttrs, string hasBody, string hasGenericParamList, - string hasName, string hasParamList, string hasRetType, string hasVisibility, - string hasWhereClause + string isAsync, string isConst, string isDefault, string isGen, string isUnsafe, string hasName, + string hasParamList, string hasRetType, string hasVisibility, string hasWhereClause where toBeTested(x) and not x.isUnknown() and @@ -13,11 +13,18 @@ where getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasBody() then hasBody = "yes" else hasBody = "no") and (if x.hasGenericParamList() then hasGenericParamList = "yes" else hasGenericParamList = "no") and + (if x.isAsync() then isAsync = "yes" else isAsync = "no") and + (if x.isConst() then isConst = "yes" else isConst = "no") and + (if x.isDefault() then isDefault = "yes" else isDefault = "no") and + (if x.isGen() then isGen = "yes" else isGen = "no") and + (if x.isUnsafe() then isUnsafe = "yes" else isUnsafe = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and (if x.hasParamList() then hasParamList = "yes" else hasParamList = "no") and (if x.hasRetType() then hasRetType = "yes" else hasRetType = "no") and (if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no") and if x.hasWhereClause() then hasWhereClause = "yes" else hasWhereClause = "no" select x, "hasAbi:", hasAbi, "getNumberOfAttrs:", getNumberOfAttrs, "hasBody:", hasBody, - "hasGenericParamList:", hasGenericParamList, "hasName:", hasName, "hasParamList:", hasParamList, - "hasRetType:", hasRetType, "hasVisibility:", hasVisibility, "hasWhereClause:", hasWhereClause + "hasGenericParamList:", hasGenericParamList, "isAsync:", isAsync, "isConst:", isConst, + "isDefault:", isDefault, "isGen:", isGen, "isUnsafe:", isUnsafe, "hasName:", hasName, + "hasParamList:", hasParamList, "hasRetType:", hasRetType, "hasVisibility:", hasVisibility, + "hasWhereClause:", hasWhereClause diff --git a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.expected b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.expected index 5f7d899ccab9..bdc57b38cf31 100644 --- a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.expected +++ b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.expected @@ -1,2 +1,2 @@ -| gen_ident_pat.rs:6:22:6:22 | y | getNumberOfAttrs: | 0 | hasName: | yes | hasPat: | no | -| gen_ident_pat.rs:10:9:10:25 | y | getNumberOfAttrs: | 0 | hasName: | yes | hasPat: | yes | +| gen_ident_pat.rs:6:22:6:22 | y | getNumberOfAttrs: | 0 | isMut: | no | isRef: | no | hasName: | yes | hasPat: | no | +| gen_ident_pat.rs:10:9:10:25 | y | getNumberOfAttrs: | 0 | isMut: | no | isRef: | no | hasName: | yes | hasPat: | yes | diff --git a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.ql b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.ql index 9b7d6f141a38..3587ccff9ae5 100644 --- a/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.ql +++ b/rust/ql/test/extractor-tests/generated/IdentPat/IdentPat.ql @@ -2,11 +2,14 @@ import codeql.rust.elements import TestUtils -from IdentPat x, int getNumberOfAttrs, string hasName, string hasPat +from IdentPat x, int getNumberOfAttrs, string isMut, string isRef, string hasName, string hasPat where toBeTested(x) and not x.isUnknown() and getNumberOfAttrs = x.getNumberOfAttrs() and + (if x.isMut() then isMut = "yes" else isMut = "no") and + (if x.isRef() then isRef = "yes" else isRef = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and if x.hasPat() then hasPat = "yes" else hasPat = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasName:", hasName, "hasPat:", hasPat +select x, "getNumberOfAttrs:", getNumberOfAttrs, "isMut:", isMut, "isRef:", isRef, "hasName:", + hasName, "hasPat:", hasPat diff --git a/rust/ql/test/extractor-tests/generated/Impl/Impl.ql b/rust/ql/test/extractor-tests/generated/Impl/Impl.ql index 72e934f58c61..b011141e5f7d 100644 --- a/rust/ql/test/extractor-tests/generated/Impl/Impl.ql +++ b/rust/ql/test/extractor-tests/generated/Impl/Impl.ql @@ -3,18 +3,23 @@ import codeql.rust.elements import TestUtils from - Impl x, string hasAssocItemList, int getNumberOfAttrs, string hasGenericParamList, - string hasSelfTy, string hasTrait, string hasVisibility, string hasWhereClause + Impl x, string hasAssocItemList, int getNumberOfAttrs, string hasGenericParamList, string isConst, + string isDefault, string isUnsafe, string hasSelfTy, string hasTrait, string hasVisibility, + string hasWhereClause where toBeTested(x) and not x.isUnknown() and (if x.hasAssocItemList() then hasAssocItemList = "yes" else hasAssocItemList = "no") and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasGenericParamList() then hasGenericParamList = "yes" else hasGenericParamList = "no") and + (if x.isConst() then isConst = "yes" else isConst = "no") and + (if x.isDefault() then isDefault = "yes" else isDefault = "no") and + (if x.isUnsafe() then isUnsafe = "yes" else isUnsafe = "no") and (if x.hasSelfTy() then hasSelfTy = "yes" else hasSelfTy = "no") and (if x.hasTrait() then hasTrait = "yes" else hasTrait = "no") and (if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no") and if x.hasWhereClause() then hasWhereClause = "yes" else hasWhereClause = "no" select x, "hasAssocItemList:", hasAssocItemList, "getNumberOfAttrs:", getNumberOfAttrs, - "hasGenericParamList:", hasGenericParamList, "hasSelfTy:", hasSelfTy, "hasTrait:", hasTrait, - "hasVisibility:", hasVisibility, "hasWhereClause:", hasWhereClause + "hasGenericParamList:", hasGenericParamList, "isConst:", isConst, "isDefault:", isDefault, + "isUnsafe:", isUnsafe, "hasSelfTy:", hasSelfTy, "hasTrait:", hasTrait, "hasVisibility:", + hasVisibility, "hasWhereClause:", hasWhereClause diff --git a/rust/ql/test/extractor-tests/generated/Meta/Meta.ql b/rust/ql/test/extractor-tests/generated/Meta/Meta.ql index 7d476131b8cd..72a0426d8098 100644 --- a/rust/ql/test/extractor-tests/generated/Meta/Meta.ql +++ b/rust/ql/test/extractor-tests/generated/Meta/Meta.ql @@ -2,11 +2,13 @@ import codeql.rust.elements import TestUtils -from Meta x, string hasExpr, string hasPath, string hasTokenTree +from Meta x, string hasExpr, string isUnsafe, string hasPath, string hasTokenTree where toBeTested(x) and not x.isUnknown() and (if x.hasExpr() then hasExpr = "yes" else hasExpr = "no") and + (if x.isUnsafe() then isUnsafe = "yes" else isUnsafe = "no") and (if x.hasPath() then hasPath = "yes" else hasPath = "no") and if x.hasTokenTree() then hasTokenTree = "yes" else hasTokenTree = "no" -select x, "hasExpr:", hasExpr, "hasPath:", hasPath, "hasTokenTree:", hasTokenTree +select x, "hasExpr:", hasExpr, "isUnsafe:", isUnsafe, "hasPath:", hasPath, "hasTokenTree:", + hasTokenTree diff --git a/rust/ql/test/extractor-tests/generated/PtrType/PtrType.ql b/rust/ql/test/extractor-tests/generated/PtrType/PtrType.ql index 4b64e7c0efe4..7dc004522c78 100644 --- a/rust/ql/test/extractor-tests/generated/PtrType/PtrType.ql +++ b/rust/ql/test/extractor-tests/generated/PtrType/PtrType.ql @@ -2,9 +2,11 @@ import codeql.rust.elements import TestUtils -from PtrType x, string hasTy +from PtrType x, string isConst, string isMut, string hasTy where toBeTested(x) and not x.isUnknown() and + (if x.isConst() then isConst = "yes" else isConst = "no") and + (if x.isMut() then isMut = "yes" else isMut = "no") and if x.hasTy() then hasTy = "yes" else hasTy = "no" -select x, "hasTy:", hasTy +select x, "isConst:", isConst, "isMut:", isMut, "hasTy:", hasTy diff --git a/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.expected b/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.expected index b5f629c6a5c7..d4c75d9a79a0 100644 --- a/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.expected +++ b/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.expected @@ -1,4 +1,4 @@ -| gen_ref_expr.rs:5:25:5:28 | RefExpr | getNumberOfAttrs: | 0 | hasExpr: | yes | -| gen_ref_expr.rs:6:23:6:30 | RefExpr | getNumberOfAttrs: | 0 | hasExpr: | yes | -| gen_ref_expr.rs:7:35:7:48 | RefExpr | getNumberOfAttrs: | 0 | hasExpr: | yes | -| gen_ref_expr.rs:8:33:8:44 | RefExpr | getNumberOfAttrs: | 0 | hasExpr: | yes | +| gen_ref_expr.rs:5:25:5:28 | RefExpr | getNumberOfAttrs: | 0 | hasExpr: | yes | isConst: | no | isMut: | no | isRaw: | no | +| gen_ref_expr.rs:6:23:6:30 | RefExpr | getNumberOfAttrs: | 0 | hasExpr: | yes | isConst: | no | isMut: | yes | isRaw: | no | +| gen_ref_expr.rs:7:35:7:48 | RefExpr | getNumberOfAttrs: | 0 | hasExpr: | yes | isConst: | yes | isMut: | no | isRaw: | yes | +| gen_ref_expr.rs:8:33:8:44 | RefExpr | getNumberOfAttrs: | 0 | hasExpr: | yes | isConst: | no | isMut: | yes | isRaw: | yes | diff --git a/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.ql b/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.ql index 7970aed3ebec..a2567b81ed75 100644 --- a/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.ql +++ b/rust/ql/test/extractor-tests/generated/RefExpr/RefExpr.ql @@ -2,10 +2,14 @@ import codeql.rust.elements import TestUtils -from RefExpr x, int getNumberOfAttrs, string hasExpr +from RefExpr x, int getNumberOfAttrs, string hasExpr, string isConst, string isMut, string isRaw where toBeTested(x) and not x.isUnknown() and getNumberOfAttrs = x.getNumberOfAttrs() and - if x.hasExpr() then hasExpr = "yes" else hasExpr = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasExpr:", hasExpr + (if x.hasExpr() then hasExpr = "yes" else hasExpr = "no") and + (if x.isConst() then isConst = "yes" else isConst = "no") and + (if x.isMut() then isMut = "yes" else isMut = "no") and + if x.isRaw() then isRaw = "yes" else isRaw = "no" +select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasExpr:", hasExpr, "isConst:", isConst, "isMut:", + isMut, "isRaw:", isRaw diff --git a/rust/ql/test/extractor-tests/generated/RefPat/RefPat.expected b/rust/ql/test/extractor-tests/generated/RefPat/RefPat.expected index 2cef03b7f5d7..c2fc3416297a 100644 --- a/rust/ql/test/extractor-tests/generated/RefPat/RefPat.expected +++ b/rust/ql/test/extractor-tests/generated/RefPat/RefPat.expected @@ -1,2 +1,2 @@ -| gen_ref_pat.rs:6:9:6:28 | RefPat | hasPat: | yes | -| gen_ref_pat.rs:7:9:7:21 | RefPat | hasPat: | yes | +| gen_ref_pat.rs:6:9:6:28 | RefPat | isMut: | yes | hasPat: | yes | +| gen_ref_pat.rs:7:9:7:21 | RefPat | isMut: | no | hasPat: | yes | diff --git a/rust/ql/test/extractor-tests/generated/RefPat/RefPat.ql b/rust/ql/test/extractor-tests/generated/RefPat/RefPat.ql index e92585faee49..4ae72433dad4 100644 --- a/rust/ql/test/extractor-tests/generated/RefPat/RefPat.ql +++ b/rust/ql/test/extractor-tests/generated/RefPat/RefPat.ql @@ -2,9 +2,10 @@ import codeql.rust.elements import TestUtils -from RefPat x, string hasPat +from RefPat x, string isMut, string hasPat where toBeTested(x) and not x.isUnknown() and + (if x.isMut() then isMut = "yes" else isMut = "no") and if x.hasPat() then hasPat = "yes" else hasPat = "no" -select x, "hasPat:", hasPat +select x, "isMut:", isMut, "hasPat:", hasPat diff --git a/rust/ql/test/extractor-tests/generated/RefType/RefType.ql b/rust/ql/test/extractor-tests/generated/RefType/RefType.ql index 63537e176306..1a0df7a0b98a 100644 --- a/rust/ql/test/extractor-tests/generated/RefType/RefType.ql +++ b/rust/ql/test/extractor-tests/generated/RefType/RefType.ql @@ -2,10 +2,11 @@ import codeql.rust.elements import TestUtils -from RefType x, string hasLifetime, string hasTy +from RefType x, string isMut, string hasLifetime, string hasTy where toBeTested(x) and not x.isUnknown() and + (if x.isMut() then isMut = "yes" else isMut = "no") and (if x.hasLifetime() then hasLifetime = "yes" else hasLifetime = "no") and if x.hasTy() then hasTy = "yes" else hasTy = "no" -select x, "hasLifetime:", hasLifetime, "hasTy:", hasTy +select x, "isMut:", isMut, "hasLifetime:", hasLifetime, "hasTy:", hasTy diff --git a/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam.ql b/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam.ql index 044de94c3800..af2fa064a724 100644 --- a/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam.ql +++ b/rust/ql/test/extractor-tests/generated/SelfParam/SelfParam.ql @@ -2,13 +2,15 @@ import codeql.rust.elements import TestUtils -from SelfParam x, int getNumberOfAttrs, string hasLifetime, string hasName, string hasTy +from + SelfParam x, int getNumberOfAttrs, string isMut, string hasLifetime, string hasName, string hasTy where toBeTested(x) and not x.isUnknown() and getNumberOfAttrs = x.getNumberOfAttrs() and + (if x.isMut() then isMut = "yes" else isMut = "no") and (if x.hasLifetime() then hasLifetime = "yes" else hasLifetime = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and if x.hasTy() then hasTy = "yes" else hasTy = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasLifetime:", hasLifetime, "hasName:", hasName, - "hasTy:", hasTy +select x, "getNumberOfAttrs:", getNumberOfAttrs, "isMut:", isMut, "hasLifetime:", hasLifetime, + "hasName:", hasName, "hasTy:", hasTy diff --git a/rust/ql/test/extractor-tests/generated/Static/Static.ql b/rust/ql/test/extractor-tests/generated/Static/Static.ql index a629119be703..a1cac0742eea 100644 --- a/rust/ql/test/extractor-tests/generated/Static/Static.ql +++ b/rust/ql/test/extractor-tests/generated/Static/Static.ql @@ -3,14 +3,17 @@ import codeql.rust.elements import TestUtils from - Static x, int getNumberOfAttrs, string hasBody, string hasName, string hasTy, string hasVisibility + Static x, int getNumberOfAttrs, string hasBody, string isMut, string isStatic, string hasName, + string hasTy, string hasVisibility where toBeTested(x) and not x.isUnknown() and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasBody() then hasBody = "yes" else hasBody = "no") and + (if x.isMut() then isMut = "yes" else isMut = "no") and + (if x.isStatic() then isStatic = "yes" else isStatic = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and (if x.hasTy() then hasTy = "yes" else hasTy = "no") and if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no" -select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasBody:", hasBody, "hasName:", hasName, "hasTy:", - hasTy, "hasVisibility:", hasVisibility +select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasBody:", hasBody, "isMut:", isMut, "isStatic:", + isStatic, "hasName:", hasName, "hasTy:", hasTy, "hasVisibility:", hasVisibility diff --git a/rust/ql/test/extractor-tests/generated/Trait/Trait.ql b/rust/ql/test/extractor-tests/generated/Trait/Trait.ql index a1f58bb68204..3551f78de6ba 100644 --- a/rust/ql/test/extractor-tests/generated/Trait/Trait.ql +++ b/rust/ql/test/extractor-tests/generated/Trait/Trait.ql @@ -3,18 +3,22 @@ import codeql.rust.elements import TestUtils from - Trait x, string hasAssocItemList, int getNumberOfAttrs, string hasGenericParamList, - string hasName, string hasTypeBoundList, string hasVisibility, string hasWhereClause + Trait x, string hasAssocItemList, int getNumberOfAttrs, string hasGenericParamList, string isAuto, + string isUnsafe, string hasName, string hasTypeBoundList, string hasVisibility, + string hasWhereClause where toBeTested(x) and not x.isUnknown() and (if x.hasAssocItemList() then hasAssocItemList = "yes" else hasAssocItemList = "no") and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasGenericParamList() then hasGenericParamList = "yes" else hasGenericParamList = "no") and + (if x.isAuto() then isAuto = "yes" else isAuto = "no") and + (if x.isUnsafe() then isUnsafe = "yes" else isUnsafe = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and (if x.hasTypeBoundList() then hasTypeBoundList = "yes" else hasTypeBoundList = "no") and (if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no") and if x.hasWhereClause() then hasWhereClause = "yes" else hasWhereClause = "no" select x, "hasAssocItemList:", hasAssocItemList, "getNumberOfAttrs:", getNumberOfAttrs, - "hasGenericParamList:", hasGenericParamList, "hasName:", hasName, "hasTypeBoundList:", - hasTypeBoundList, "hasVisibility:", hasVisibility, "hasWhereClause:", hasWhereClause + "hasGenericParamList:", hasGenericParamList, "isAuto:", isAuto, "isUnsafe:", isUnsafe, "hasName:", + hasName, "hasTypeBoundList:", hasTypeBoundList, "hasVisibility:", hasVisibility, + "hasWhereClause:", hasWhereClause diff --git a/rust/ql/test/extractor-tests/generated/TypeAlias/TypeAlias.ql b/rust/ql/test/extractor-tests/generated/TypeAlias/TypeAlias.ql index 10494cb2889d..240791745dcd 100644 --- a/rust/ql/test/extractor-tests/generated/TypeAlias/TypeAlias.ql +++ b/rust/ql/test/extractor-tests/generated/TypeAlias/TypeAlias.ql @@ -3,18 +3,19 @@ import codeql.rust.elements import TestUtils from - TypeAlias x, int getNumberOfAttrs, string hasGenericParamList, string hasName, string hasTy, - string hasTypeBoundList, string hasVisibility, string hasWhereClause + TypeAlias x, int getNumberOfAttrs, string hasGenericParamList, string isDefault, string hasName, + string hasTy, string hasTypeBoundList, string hasVisibility, string hasWhereClause where toBeTested(x) and not x.isUnknown() and getNumberOfAttrs = x.getNumberOfAttrs() and (if x.hasGenericParamList() then hasGenericParamList = "yes" else hasGenericParamList = "no") and + (if x.isDefault() then isDefault = "yes" else isDefault = "no") and (if x.hasName() then hasName = "yes" else hasName = "no") and (if x.hasTy() then hasTy = "yes" else hasTy = "no") and (if x.hasTypeBoundList() then hasTypeBoundList = "yes" else hasTypeBoundList = "no") and (if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no") and if x.hasWhereClause() then hasWhereClause = "yes" else hasWhereClause = "no" select x, "getNumberOfAttrs:", getNumberOfAttrs, "hasGenericParamList:", hasGenericParamList, - "hasName:", hasName, "hasTy:", hasTy, "hasTypeBoundList:", hasTypeBoundList, "hasVisibility:", - hasVisibility, "hasWhereClause:", hasWhereClause + "isDefault:", isDefault, "hasName:", hasName, "hasTy:", hasTy, "hasTypeBoundList:", + hasTypeBoundList, "hasVisibility:", hasVisibility, "hasWhereClause:", hasWhereClause diff --git a/rust/ql/test/extractor-tests/generated/TypeBound/TypeBound.ql b/rust/ql/test/extractor-tests/generated/TypeBound/TypeBound.ql index 06e117fe2242..449ca67ed71e 100644 --- a/rust/ql/test/extractor-tests/generated/TypeBound/TypeBound.ql +++ b/rust/ql/test/extractor-tests/generated/TypeBound/TypeBound.ql @@ -2,11 +2,16 @@ import codeql.rust.elements import TestUtils -from TypeBound x, string hasGenericParamList, string hasLifetime, string hasTy +from + TypeBound x, string hasGenericParamList, string isAsync, string isConst, string hasLifetime, + string hasTy where toBeTested(x) and not x.isUnknown() and (if x.hasGenericParamList() then hasGenericParamList = "yes" else hasGenericParamList = "no") and + (if x.isAsync() then isAsync = "yes" else isAsync = "no") and + (if x.isConst() then isConst = "yes" else isConst = "no") and (if x.hasLifetime() then hasLifetime = "yes" else hasLifetime = "no") and if x.hasTy() then hasTy = "yes" else hasTy = "no" -select x, "hasGenericParamList:", hasGenericParamList, "hasLifetime:", hasLifetime, "hasTy:", hasTy +select x, "hasGenericParamList:", hasGenericParamList, "isAsync:", isAsync, "isConst:", isConst, + "hasLifetime:", hasLifetime, "hasTy:", hasTy diff --git a/rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected b/rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected index 39125607e963..bdfa4a9792dd 100644 --- a/rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected +++ b/rust/ql/test/query-tests/diagnostics/CONSISTENCY/ExtractionConsistency.expected @@ -1,3 +1,4 @@ +extractionWarning | does_not_compile.rs:2:6:2:5 | expected SEMICOLON | | does_not_compile.rs:2:9:2:8 | expected SEMICOLON | | does_not_compile.rs:2:13:2:12 | expected SEMICOLON | diff --git a/rust/ql/test/query-tests/diagnostics/ExtractionErrors.expected b/rust/ql/test/query-tests/diagnostics/ExtractionErrors.expected index 84fc94c78d17..e69de29bb2d1 100644 --- a/rust/ql/test/query-tests/diagnostics/ExtractionErrors.expected +++ b/rust/ql/test/query-tests/diagnostics/ExtractionErrors.expected @@ -1,7 +0,0 @@ -| does_not_compile.rs:2:6:2:5 | expected SEMICOLON | Extraction failed in does_not_compile.rs with error expected SEMICOLON | 2 | -| does_not_compile.rs:2:9:2:8 | expected SEMICOLON | Extraction failed in does_not_compile.rs with error expected SEMICOLON | 2 | -| does_not_compile.rs:2:13:2:12 | expected SEMICOLON | Extraction failed in does_not_compile.rs with error expected SEMICOLON | 2 | -| does_not_compile.rs:2:21:2:20 | expected SEMICOLON | Extraction failed in does_not_compile.rs with error expected SEMICOLON | 2 | -| does_not_compile.rs:2:26:2:25 | expected SEMICOLON | Extraction failed in does_not_compile.rs with error expected SEMICOLON | 2 | -| does_not_compile.rs:2:32:2:31 | expected field name or number | Extraction failed in does_not_compile.rs with error expected field name or number | 2 | -| error.rs:2:5:2:17 | An error! | Extraction failed in error.rs with error An error! | 2 | diff --git a/rust/ql/test/query-tests/diagnostics/ExtractionWarnings.expected b/rust/ql/test/query-tests/diagnostics/ExtractionWarnings.expected new file mode 100644 index 000000000000..1ebd7e232214 --- /dev/null +++ b/rust/ql/test/query-tests/diagnostics/ExtractionWarnings.expected @@ -0,0 +1,7 @@ +| does_not_compile.rs:2:6:2:5 | expected SEMICOLON | Extraction warning in does_not_compile.rs with message expected SEMICOLON | 1 | +| does_not_compile.rs:2:9:2:8 | expected SEMICOLON | Extraction warning in does_not_compile.rs with message expected SEMICOLON | 1 | +| does_not_compile.rs:2:13:2:12 | expected SEMICOLON | Extraction warning in does_not_compile.rs with message expected SEMICOLON | 1 | +| does_not_compile.rs:2:21:2:20 | expected SEMICOLON | Extraction warning in does_not_compile.rs with message expected SEMICOLON | 1 | +| does_not_compile.rs:2:26:2:25 | expected SEMICOLON | Extraction warning in does_not_compile.rs with message expected SEMICOLON | 1 | +| does_not_compile.rs:2:32:2:31 | expected field name or number | Extraction warning in does_not_compile.rs with message expected field name or number | 1 | +| error.rs:2:5:2:17 | An error! | Extraction warning in error.rs with message An error! | 1 | diff --git a/rust/ql/test/query-tests/diagnostics/ExtractionWarnings.qlref b/rust/ql/test/query-tests/diagnostics/ExtractionWarnings.qlref new file mode 100644 index 000000000000..ff6e566d20a7 --- /dev/null +++ b/rust/ql/test/query-tests/diagnostics/ExtractionWarnings.qlref @@ -0,0 +1 @@ +queries/diagnostics/ExtractionWarnings.ql diff --git a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected index 03f12b16d8dc..100ade0c0203 100644 --- a/rust/ql/test/query-tests/diagnostics/SummaryStats.expected +++ b/rust/ql/test/query-tests/diagnostics/SummaryStats.expected @@ -1,5 +1,9 @@ | Elements extracted | 376 | | Elements unextracted | 0 | -| Files extracted | 7 | +| Extraction errors | 0 | +| Extraction warnings | 7 | +| Files extracted - total | 7 | +| Files extracted - with errors | 2 | +| Files extracted - without errors | 5 | | Lines of code extracted | 59 | | Lines of user code extracted | 59 | diff --git a/rust/schema/annotations.py b/rust/schema/annotations.py index 2046aa9e5365..1cee04dd4b83 100644 --- a/rust/schema/annotations.py +++ b/rust/schema/annotations.py @@ -191,8 +191,15 @@ class _: ``` """ +class CallExprBase(Expr): + """ + A function or method call expression. See `CallExpr` and `MethodCallExpr` for further details. + """ + arg_list: optional["ArgList"] | child + attrs: list["Attr"] | child -@annotate(CallExpr) + +@annotate(CallExpr, replace_bases={Expr: CallExprBase}) class _: """ A function call expression. For example: @@ -203,9 +210,10 @@ class _: foo(1) = 4; ``` """ + arg_list: drop + attrs: drop - -@annotate(MethodCallExpr) +@annotate(MethodCallExpr, replace_bases={Expr: CallExprBase}) class _: """ A method call expression. For example: @@ -214,6 +222,8 @@ class _: x.foo::(42); ``` """ + arg_list: drop + attrs: drop @annotate(MatchArm) diff --git a/rust/schema/ast.py b/rust/schema/ast.py index 6e146c7c54d9..bdbb1990d308 100644 --- a/rust/schema/ast.py +++ b/rust/schema/ast.py @@ -83,6 +83,12 @@ class BinaryExpr(Expr): class BlockExpr(Expr): attrs: list["Attr"] | child + is_async: predicate + is_const: predicate + is_gen: predicate + is_move: predicate + is_try: predicate + is_unsafe: predicate label: optional["Label"] | child stmt_list: optional["StmtList"] | child @@ -111,12 +117,19 @@ class ClosureExpr(Expr): attrs: list["Attr"] | child body: optional["Expr"] | child closure_binder: optional["ClosureBinder"] | child + is_async: predicate + is_const: predicate + is_gen: predicate + is_move: predicate + is_static: predicate param_list: optional["ParamList"] | child ret_type: optional["RetType"] | child class Const(AssocItem,Item): attrs: list["Attr"] | child body: optional["Expr"] | child + is_const: predicate + is_default: predicate name: optional["Name"] | child ty: optional["TypeRef"] | child visibility: optional["Visibility"] | child @@ -126,10 +139,12 @@ class ConstArg(GenericArg): class ConstBlockPat(Pat): block_expr: optional["BlockExpr"] | child + is_const: predicate class ConstParam(GenericParam): attrs: list["Attr"] | child default_val: optional["ConstArg"] | child + is_const: predicate name: optional["Name"] | child ty: optional["TypeRef"] | child @@ -155,6 +170,7 @@ class ExternBlock(Item): abi: optional["Abi"] | child attrs: list["Attr"] | child extern_item_list: optional["ExternItemList"] | child + is_unsafe: predicate class ExternCrate(Item): attrs: list["Attr"] | child @@ -176,6 +192,11 @@ class Function(AssocItem,ExternItem,Item): attrs: list["Attr"] | child body: optional["BlockExpr"] | child generic_param_list: optional["GenericParamList"] | child + is_async: predicate + is_const: predicate + is_default: predicate + is_gen: predicate + is_unsafe: predicate name: optional["Name"] | child param_list: optional["ParamList"] | child ret_type: optional["RetType"] | child @@ -184,6 +205,9 @@ class Function(AssocItem,ExternItem,Item): class FnPtrType(TypeRef): abi: optional["Abi"] | child + is_async: predicate + is_const: predicate + is_unsafe: predicate param_list: optional["ParamList"] | child ret_type: optional["RetType"] | child @@ -215,6 +239,8 @@ class GenericParamList(AstNode): class IdentPat(Pat): attrs: list["Attr"] | child + is_mut: predicate + is_ref: predicate name: optional["Name"] | child pat: optional["Pat"] | child @@ -228,6 +254,9 @@ class Impl(Item): assoc_item_list: optional["AssocItemList"] | child attrs: list["Attr"] | child generic_param_list: optional["GenericParamList"] | child + is_const: predicate + is_default: predicate + is_unsafe: predicate self_ty: optional["TypeRef"] | child trait_: optional["TypeRef"] | child visibility: optional["Visibility"] | child @@ -343,6 +372,7 @@ class MatchGuard(AstNode): class Meta(AstNode): expr: optional["Expr"] | child + is_unsafe: predicate path: optional["Path"] | child token_tree: optional["TokenTree"] | child @@ -424,6 +454,8 @@ class PrefixExpr(Expr): operator_name: optional[string] class PtrType(TypeRef): + is_const: predicate + is_mut: predicate ty: optional["TypeRef"] | child class RangeExpr(Expr): @@ -476,11 +508,16 @@ class RecordPatFieldList(AstNode): class RefExpr(Expr): attrs: list["Attr"] | child expr: optional["Expr"] | child + is_const: predicate + is_mut: predicate + is_raw: predicate class RefPat(Pat): + is_mut: predicate pat: optional["Pat"] | child class RefType(TypeRef): + is_mut: predicate lifetime: optional["Lifetime"] | child ty: optional["TypeRef"] | child @@ -502,6 +539,7 @@ class ReturnTypeSyntax(AstNode): class SelfParam(AstNode): attrs: list["Attr"] | child + is_mut: predicate lifetime: optional["Lifetime"] | child name: optional["Name"] | child ty: optional["TypeRef"] | child @@ -519,6 +557,8 @@ class SourceFile(AstNode): class Static(ExternItem,Item): attrs: list["Attr"] | child body: optional["Expr"] | child + is_mut: predicate + is_static: predicate name: optional["Name"] | child ty: optional["TypeRef"] | child visibility: optional["Visibility"] | child @@ -543,6 +583,8 @@ class Trait(Item): assoc_item_list: optional["AssocItemList"] | child attrs: list["Attr"] | child generic_param_list: optional["GenericParamList"] | child + is_auto: predicate + is_unsafe: predicate name: optional["Name"] | child type_bound_list: optional["TypeBoundList"] | child visibility: optional["Visibility"] | child @@ -585,6 +627,7 @@ class TupleType(TypeRef): class TypeAlias(AssocItem,ExternItem,Item): attrs: list["Attr"] | child generic_param_list: optional["GenericParamList"] | child + is_default: predicate name: optional["Name"] | child ty: optional["TypeRef"] | child type_bound_list: optional["TypeBoundList"] | child @@ -596,6 +639,8 @@ class TypeArg(GenericArg): class TypeBound(AstNode): generic_param_list: optional["GenericParamList"] | child + is_async: predicate + is_const: predicate lifetime: optional["Lifetime"] | child ty: optional["TypeRef"] | child