Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
One or more issues must be addressed before approval.
Review effort: Balanced
Findings: 2
Open (3)
What changed in this PR
Updates CodeQL’s Rust extractor to rust-analyzer 0.0.357 and exposes its new configuration-predicate AST nodes.
Changes:
- Updates workspace dependencies, Bazel definitions, source archive, and fixed extraction toolchain.
- Adds generated extraction, AST, and CFG interfaces for
CfgPredExprandCfgPredPat. - Adds schema migrations, a change note, test placeholders, and CodeQL setup for automation.
| File | Description |
|---|---|
| unified/extractor/Cargo.toml | Updated as part of this pull request. |
| shared/tree-sitter-extractor/Cargo.toml | Updated as part of this pull request. |
| rust/scripts/update_rust_analyzer.py | Updated as part of this pull request. |
| rust/schema/ast.py | Updated as part of this pull request. |
| rust/ql/test/setup.sh | Updated as part of this pull request. |
| rust/ql/test/extractor-tests/generated/CfgPredPat/MISSING_SOURCE.txt | Updated as part of this pull request. |
| rust/ql/test/extractor-tests/generated/CfgPredExpr/MISSING_SOURCE.txt | Updated as part of this pull request. |
| rust/ql/lib/upgrades/3af0bba56aa51dfb325939cc3b52cd0a3eb0965f/upgrade.properties | Updated as part of this pull request. |
| rust/ql/lib/rust.dbscheme | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/internal/generated/SynthConstructors.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/internal/generated/Synth.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/internal/generated/Raw.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/internal/generated/ParentChild.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/internal/generated/CfgPredPat.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/internal/generated/CfgPredExpr.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/internal/CfgPredPatImpl.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/internal/CfgPredPatConstructor.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/internal/CfgPredExprImpl.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/internal/CfgPredExprConstructor.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/CfgPredPat.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements/CfgPredExpr.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/elements.qll | Updated as part of this pull request. |
| rust/ql/lib/codeql/rust/controlflow/internal/generated/CfgNodes.qll | Updated as part of this pull request. |
| rust/ql/lib/change-notes/2026-10-07-rust-analyzer-0.0.357.md | Updated as part of this pull request. |
| rust/ql/integration-tests/conftest.py | Updated as part of this pull request. |
| rust/ql/.gitattributes | Updated as part of this pull request. |
| rust/ql/.generated.list | Updated as part of this pull request. |
| rust/extractor/src/translate/generated.rs | Updated as part of this pull request. |
| rust/extractor/src/toolchain.rs | Updated as part of this pull request. |
| rust/extractor/src/generated/top.rs | Updated as part of this pull request. |
| rust/extractor/src/generated/.generated.list | Updated as part of this pull request. |
| rust/extractor/Cargo.toml | Updated as part of this pull request. |
| rust/downgrades/9487e73d9da6508522f07a34bc4aafa8d55c0f5f/upgrade.properties | Updated as part of this pull request. |
| rust/downgrades/9487e73d9da6508522f07a34bc4aafa8d55c0f5f/downgrade.ql | Updated as part of this pull request. |
| rust/ast-generator/Cargo.toml | Updated as part of this pull request. |
| ruby/extractor/Cargo.toml | Updated as part of this pull request. |
| MODULE.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/stdx/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/stdx-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/serde_with/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/serde_with-3.24.0/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/serde_with-3.23.0/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_vfs/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_vfs-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_toolchain/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_toolchain-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_syntax/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_syntax-bridge/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_syntax-bridge-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_syntax-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_syntax-0.0.352/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_stdx-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_stdx-0.0.352/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_span/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_span-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_span-0.0.352/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_project_model/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_project_model-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_paths/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_paths-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_paths-0.0.352/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_parser/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_parser-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_parser-0.0.352/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_load-cargo/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_load-cargo-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_intern/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_intern-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_intern-0.0.352/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_ide_db/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_ide_db-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_ide_db-0.0.352/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_hir/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_hir-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_hir_ty/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_hir_ty-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_hir_ty-0.0.352/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_hir_expand/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_hir_expand-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_hir_def/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_hir_def-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_cfg/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_cfg-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_base_db/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/ra_ap_base_db-0.0.357/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/lazy_static/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/lazy_static-1.5.1/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/either/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/either-1.19.0/BUILD.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.tracing-flame-0.2.0.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.sharded-slab-0.1.7.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_with-3.24.0.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.serde_with_macros-3.24.0.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.salsa-macros-0.28.5.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.salsa-macro-rules-0.28.5.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.salsa-0.28.5.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.rayon-1.12.0.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-notify-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_vfs-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_tt-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_toolchain-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_test_utils-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_test_fixture-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-bridge-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_syntax-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_stdx-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_span-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_project_model-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_profile-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_proc_macro_api-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_paths-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_parser-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_mbe-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_macros-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_load-cargo-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_intern-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_ide_db-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_ty-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_expand-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_hir_def-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_edition-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_cfg-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.ra_ap_base_db-0.0.357.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.lazy_static-1.5.1.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.itertools-0.15.0.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.either-1.19.0.bazel | Updated as part of this pull request. |
| misc/bazel/3rdparty/tree_sitter_extractors_deps/BUILD.bazel | Updated as part of this pull request. |
| Cargo.lock | Updated as part of this pull request. |
| .github/workflows/update-rust-analyzer.md | Updated as part of this pull request. |
| .github/workflows/update-rust-analyzer.lock.yml | Updated as part of this pull request. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| query predicate new_locatable_locations(Element id, Location location) { | ||
| locatable_locations(id, location) and not cfg_pred_exprs(id) and not cfg_pred_pats(id) |
| cfg_pred_exprs.rel: delete | ||
| cfg_pred_expr_cfg_predicates.rel: delete | ||
| cfg_pred_pats.rel: delete | ||
| cfg_pred_pat_cfg_predicates.rel: delete |
There was a problem hiding this comment.
Is Copilot right? My suspicion is that everything else would point to the target cfg_predicate not the cfg_pred_expr, and the cfg_predicate exists both before and after the upgrade, so we're safe to remove the cfg_pred_exprs entry???
| class CfgPredExpr(Expr, ): | ||
| cfg_predicate: optional["CfgPredicate"] | child | ||
|
|
||
| class CfgPredPat(Pat, ): | ||
| cfg_predicate: optional["CfgPredicate"] | child |
de28b14 to
043140e
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9aa1104f-468b-4aa4-b605-e46c22c1e398
Add models for the alloc/core canonical I/O paths introduced by Rust 1.99. Regenerate the file, network, stdin, and cleartext logging expectations to restore the missing flows. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9aa1104f-468b-4aa4-b605-e46c22c1e398
Rust 1.99 changed pin! to wrap its argument in PinMacroHelper and pass that wrapper through pin_new_unchecked_in_helper before constructing the Pin. Model value flow from the helper's value field to the returned Pin pointer and update the modeled-flow expectation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9aa1104f-468b-4aa4-b605-e46c22c1e398
043140e to
34b3ec4
Compare
geoffw0
left a comment
There was a problem hiding this comment.
The first 5 commits are created by the automated script and are standard.
👍
The upgrade and downgrade scripts.
I've asked a couple of questions about these (quite likely from a place of ignorance). As has Copilot.
The changes to the models. Some things have been moved around inside the standard library, which caused some canonical paths to change.
New models LGTM.
The models are now duplicated with both the old canonical path and the new one. We could delete the old ones, but then analysis quality would be reduced for older databases.
We could mark the old ones for deletion in a year or something. I'm not sure whether it's worth doing. They shouldn't affect performance very much and there's a [small] risk of deleting something that's still useful.
| // `CfgPredExpr` and `CfgPredPat` are new node kinds with no representation in the old schema, so we | ||
| // scrub their locations. | ||
| query predicate new_locatable_locations(Element id, Location location) { | ||
| locatable_locations(id, location) and not cfg_pred_exprs(id) and not cfg_pred_pats(id) |
There was a problem hiding this comment.
Why would there be a locatable_locations for a CfgPredExpr in the old schema, if it doesn't contain any CfgPredExprs?
There was a problem hiding this comment.
My understanding is that since this is a downgrade script there might be locations that refer to the new node kinds, and we want to remove those locations.
| cfg_pred_exprs.rel: delete | ||
| cfg_pred_expr_cfg_predicates.rel: delete | ||
| cfg_pred_pats.rel: delete | ||
| cfg_pred_pat_cfg_predicates.rel: delete |
There was a problem hiding this comment.
Is Copilot right? My suspicion is that everything else would point to the target cfg_predicate not the cfg_pred_expr, and the cfg_predicate exists both before and after the upgrade, so we're safe to remove the cfg_pred_exprs entry???


Updates rust-analyzer to version 0.0.357 in order to support Rust 1.99.
Note to reviewer:
The DCA report shows some changes, but I don't think they're significant enough that we should worry about them. I might dig into them, but even if I find anything I think we should address that in follow up PRs.