Skip to content

Rust: Update rust-analyzer to 0.0.357 - #22776

Draft
paldepind wants to merge 11 commits into
mainfrom
automation/update-rust-analyzer/rust/update-workflow-4f7597f07f88ccf6
Draft

paldepind wants to merge 11 commits into
mainfrom
automation/update-rust-analyzer/rust/update-workflow-4f7597f07f88ccf6

Conversation

@paldepind

Copy link
Copy Markdown
Contributor

Automated rust-analyzer update (rust/scripts/update_rust_analyzer.py, exit status 0).

Changes

  • Cargo: upgraded dependencies; all ra_ap_* crates are at 0.0.357.
  • Updated rust-analyzer sources, fixed toolchain, and vendored Bazel cargo dependencies.
  • Codegen: schema adds CfgPredExpr (an Expr) and CfgPredPat (a Pat), each with a cfg_predicate child.
  • Added a DB upgrade (full compatibility) and downgrade (partial; drops the new nodes and their locations), plus a change note.

Validation

  • The updater ran bazel run //rust/codegen and bazel run //rust:install successfully.
  • The upgrade/downgrade scripts were checked against existing conventions and the dbscheme hashes, but they were not compiled or run on a database. codeql query compile of the downgrade failed because old.dbscheme.stats is missing.
  • The new generated tests for CfgPredExpr and CfgPredPat only have MISSING_SOURCE.txt placeholders. Nothing in this run added test sources for them.
  • CI for this PR could not be awaited in this run, and DCA was not run.

Next steps for a maintainer

  • Check CI, including the Rust integration tests and QL tests.
  • Run DCA with database caching disabled.
  • If CI complains about the dbscheme stats or the upgrade scripts, regenerate them.

Copilot AI balanced review requested due to automatic review settings October 7, 2026 11:23
@paldepind
paldepind requested review from a team as code owners October 7, 2026 11:23
Comment on lines +783 to +784
/**
*/
Comment on lines +808 to +809
/**
*/

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Review effort: Balanced
Findings: 2 High severity · 1 Low severity

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 CfgPredExpr and CfgPredPat.
  • 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.

Comment on lines +11 to +12
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)
Comment on lines +4 to +7
cfg_pred_exprs.rel: delete
cfg_pred_expr_cfg_predicates.rel: delete
cfg_pred_pats.rel: delete
cfg_pred_pat_cfg_predicates.rel: delete
Comment thread rust/schema/ast.py
Comment on lines +189 to +193
class CfgPredExpr(Expr, ):
cfg_predicate: optional["CfgPredicate"] | child

class CfgPredPat(Pat, ):
cfg_predicate: optional["CfgPredicate"] | child
@github-actions github-actions Bot added documentation Ruby Rust Pull requests that update Rust code Unified labels Oct 7, 2026
@paldepind
paldepind marked this pull request as draft October 7, 2026 11:35
Co-authored-by: Copilot <[email protected]>

Copilot-Session: 9aa1104f-468b-4aa4-b605-e46c22c1e398
rust-analyzer 0.0.357 fails to resolve many standard-library call targets against the Rust 1.99.0 sysroot, which drops data-flow models and query results. Keep the analysis sysroot at 1.98.1 while retaining the rust-analyzer update.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 9aa1104f-468b-4aa4-b605-e46c22c1e398
Restore the Rust 1.99 analysis toolchain and model the canonical alloc/core I/O paths introduced by that release. Add a summary for the new pin macro helper so pin! retains value flow, then regenerate the affected expectations without test failures.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 9aa1104f-468b-4aa4-b605-e46c22c1e398

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Ruby Rust Pull requests that update Rust code Unified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants