From 4ec18c8a795107026b87be2a3159017e3eb517a6 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:21:52 +0100 Subject: [PATCH 1/6] Rust: Remove the experimental note in supported-frameworks.rst. --- docs/codeql/reusables/supported-frameworks.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/codeql/reusables/supported-frameworks.rst b/docs/codeql/reusables/supported-frameworks.rst index 8e00d32a7297..e9981014ef5f 100644 --- a/docs/codeql/reusables/supported-frameworks.rst +++ b/docs/codeql/reusables/supported-frameworks.rst @@ -313,7 +313,6 @@ Rust built-in support Provided by the current versions of the CodeQL query pack ``codeql/rust-queries`` (`changelog `__, `source `__) and the CodeQL library pack ``codeql/rust-all`` (`changelog `__, `source `__). -All support is experimental. .. csv-table:: :header-rows: 1 From 3b1d6cd3d93e3abba44bd167cf9be2e7019d56ff Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:31:26 +0100 Subject: [PATCH 2/6] Rust: Add missing link (to existing doc). --- docs/codeql/writing-codeql-queries/creating-path-queries.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/codeql/writing-codeql-queries/creating-path-queries.rst b/docs/codeql/writing-codeql-queries/creating-path-queries.rst index 7e178f94b44f..e21092e3aba8 100644 --- a/docs/codeql/writing-codeql-queries/creating-path-queries.rst +++ b/docs/codeql/writing-codeql-queries/creating-path-queries.rst @@ -33,6 +33,7 @@ For more language-specific information on analyzing data flow, see: - ":ref:`Analyzing data flow in JavaScript/TypeScript `" - ":ref:`Analyzing data flow in Python `" - ":ref:`Analyzing data flow in Ruby `" +- ":ref:`Analyzing data flow in Rust `" - ":ref:`Analyzing data flow in Swift `" Path query examples From fb738f2d020b697812b7e42b1f1d87ff6423eed8 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:36:39 +0100 Subject: [PATCH 3/6] Rust: Update creating-path-queries.rst. --- .../codeql/writing-codeql-queries/creating-path-queries.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/codeql/writing-codeql-queries/creating-path-queries.rst b/docs/codeql/writing-codeql-queries/creating-path-queries.rst index e21092e3aba8..750085e839ea 100644 --- a/docs/codeql/writing-codeql-queries/creating-path-queries.rst +++ b/docs/codeql/writing-codeql-queries/creating-path-queries.rst @@ -60,7 +60,7 @@ You should use the following template: */ import - // For some languages (Java/C++/Python/Swift) you need to explicitly import the data flow library, such as + // For some languages (Java/C++/Python/Rust/Swift) you need to explicitly import the data flow library, such as // import semmle.code.java.dataflow.DataFlow or import codeql.swift.dataflow.DataFlow ... @@ -125,7 +125,7 @@ Declaring sources and sinks You must provide information about the ``source`` and ``sink`` in your path query. These are objects that correspond to the nodes of the paths that you are exploring. The name and the type of the ``source`` and the ``sink`` must be declared in the ``from`` statement of the query, and the types must be compatible with the nodes of the graph computed by the ``edges`` predicate. -If you are querying C/C++, C#, Go, Java/Kotlin, JavaScript/TypeScript, Python, or Ruby code (and you have used ``import MyFlow::PathGraph`` in your query), the definitions of the ``source`` and ``sink`` are accessed via the module resulting from the application of the ``Global<..>`` module in the data flow library. You should declare both of these objects in the ``from`` statement. +If you are querying C/C++, C#, Go, Java/Kotlin, JavaScript/TypeScript, Python, Ruby or Rust code (and you have used ``import MyFlow::PathGraph`` in your query), the definitions of the ``source`` and ``sink`` are accessed via the module resulting from the application of the ``Global<..>`` module in the data flow library. You should declare both of these objects in the ``from`` statement. For example: .. code-block:: ql @@ -146,7 +146,7 @@ The configuration module must be defined to include definitions of sources and s - ``isSource()`` defines where data may flow from. - ``isSink()`` defines where data may flow to. -For more information on using the configuration class in your analysis see the sections on global data flow in ":ref:`Analyzing data flow in C/C++ `," ":ref:`Analyzing data flow in C# `," and ":ref:`Analyzing data flow in Python `." +For more information on using the configuration class in your analysis see the sections on global data flow in ":ref:`Analyzing data flow in C/C++ `," ":ref:`Analyzing data flow in C# `," ":ref:`Analyzing data flow in Python `," and ":ref:`Analyzing data flow in Rust `." You can also create a configuration for different frameworks and environments by extending the ``Configuration`` class. For more information, see ":ref:`Types `" in the QL language reference. From 479e735e77a1316557c3e0795119276441ed1559 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Thu, 2 Oct 2025 18:43:17 +0100 Subject: [PATCH 4/6] Rust: Mirror information from supported-versions-compilers.rst in system-requirements.rst. --- docs/codeql/codeql-overview/system-requirements.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/codeql/codeql-overview/system-requirements.rst b/docs/codeql/codeql-overview/system-requirements.rst index cc46db60c35b..8e1820d2123e 100644 --- a/docs/codeql/codeql-overview/system-requirements.rst +++ b/docs/codeql/codeql-overview/system-requirements.rst @@ -42,6 +42,10 @@ For Ruby extraction: - On Windows, the ``msvcp140.dll`` must be installed and available on the system. This can be installed by downloading the appropriate Microsoft Visual C++ Redistributable for Visual Studio. +For Rust extraction: + +- Requires ``rustup`` and ``cargo`` to be installed. + For Java extraction: - There must be a ``java`` or ``java.exe`` executable available on the ``PATH``, and the ``JAVA_HOME`` environment variable must point to the corresponding JDK's home directory. From a31c10c4fa345b5076c7dd2ae071e5de491addf2 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 6 Oct 2025 11:37:40 +0100 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: mc <42146119+mchammer01@users.noreply.github.com> --- docs/codeql/codeql-overview/system-requirements.rst | 2 +- docs/codeql/writing-codeql-queries/creating-path-queries.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/codeql/codeql-overview/system-requirements.rst b/docs/codeql/codeql-overview/system-requirements.rst index 8e1820d2123e..94fee8cd7b28 100644 --- a/docs/codeql/codeql-overview/system-requirements.rst +++ b/docs/codeql/codeql-overview/system-requirements.rst @@ -44,7 +44,7 @@ For Ruby extraction: For Rust extraction: -- Requires ``rustup`` and ``cargo`` to be installed. +- `rustup`` and ``cargo`` must be installed. For Java extraction: diff --git a/docs/codeql/writing-codeql-queries/creating-path-queries.rst b/docs/codeql/writing-codeql-queries/creating-path-queries.rst index 750085e839ea..2e439baa7f41 100644 --- a/docs/codeql/writing-codeql-queries/creating-path-queries.rst +++ b/docs/codeql/writing-codeql-queries/creating-path-queries.rst @@ -125,7 +125,7 @@ Declaring sources and sinks You must provide information about the ``source`` and ``sink`` in your path query. These are objects that correspond to the nodes of the paths that you are exploring. The name and the type of the ``source`` and the ``sink`` must be declared in the ``from`` statement of the query, and the types must be compatible with the nodes of the graph computed by the ``edges`` predicate. -If you are querying C/C++, C#, Go, Java/Kotlin, JavaScript/TypeScript, Python, Ruby or Rust code (and you have used ``import MyFlow::PathGraph`` in your query), the definitions of the ``source`` and ``sink`` are accessed via the module resulting from the application of the ``Global<..>`` module in the data flow library. You should declare both of these objects in the ``from`` statement. +If you are querying C/C++, C#, Go, Java/Kotlin, JavaScript/TypeScript, Python, Ruby, or Rust code (and you have used ``import MyFlow::PathGraph`` in your query), the definitions of the ``source`` and ``sink`` are accessed via the module resulting from the application of the ``Global<..>`` module in the data flow library. You should declare both of these objects in the ``from`` statement. For example: .. code-block:: ql From 1c8ee0af898e3989848430dc8607a91b367accf9 Mon Sep 17 00:00:00 2001 From: Geoffrey White <40627776+geoffw0@users.noreply.github.com> Date: Mon, 6 Oct 2025 11:40:41 +0100 Subject: [PATCH 6/6] Rust: Fix backticks. --- docs/codeql/codeql-overview/system-requirements.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/codeql/codeql-overview/system-requirements.rst b/docs/codeql/codeql-overview/system-requirements.rst index 94fee8cd7b28..100b75445b2e 100644 --- a/docs/codeql/codeql-overview/system-requirements.rst +++ b/docs/codeql/codeql-overview/system-requirements.rst @@ -44,7 +44,7 @@ For Ruby extraction: For Rust extraction: -- `rustup`` and ``cargo`` must be installed. +- ``rustup`` and ``cargo`` must be installed. For Java extraction: