Skip to content

Use Rust edition 2024 for all workspace crates - #23286

Open
paldepind wants to merge 2 commits into
mainfrom
rust-edition
Open

paldepind wants to merge 2 commits into
mainfrom
rust-edition

Conversation

@paldepind

@paldepind paldepind commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Some of our crates (yeast, yeast-macros, yeast-schema, the QL extractor and buramu) were still on edition 2021. It's nice to be on the most recent version and it's nice not to have discrepancies across craet.s

This sets edition = "2024" once in the root workspace file and makes all workspace packages inherit it.

Bazel already uses 2024 via RUST_EDITION in MODULE.bazel so no changes is made to the Bazel setup.

The first commit has the manifest changes plus the one change required to compile (extern "C" should be unsafe extern "C" in tree-sitter-blame).

The second commit applies Clippy fixes and rustfmt formatting changes.

paldepind and others added 2 commits November 27, 2026 18:21
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 23953e7a-978d-432c-afda-c9be5ffedfa6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 23953e7a-978d-432c-afda-c9be5ffedfa6
@paldepind
paldepind marked this pull request as ready for review November 29, 2026 07:49
@paldepind
paldepind requested review from a team as code owners November 29, 2026 07:49
Copilot AI adaptive review requested due to automatic review settings November 29, 2026 07:49

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.

🔵 Needs a closer look

The edition migration changes lifetime capture and generated-macro parsing across shared libraries and extraction tools, requiring downstream compatibility review beyond a mechanical manifest check.

No open issues 🎉

What changed in this PR

This PR standardizes workspace crates on Rust edition 2024 through a shared Cargo setting, aligning Cargo builds with the existing Bazel edition.

Changes:

  • Define the edition once and inherit it in all workspace package manifests.
  • Update the tree-sitter-blame foreign-function declaration for edition 2024.
  • Apply Clippy and rustfmt changes and refresh generated Bazel edition metadata.
File Description
unified/​swift-syntax-rs/​Cargo.toml Inherit the workspace edition.
unified/​extractor/​Cargo.toml Inherit the workspace edition.
unified/​extractor-unsupported-os/​Cargo.toml Inherit the workspace edition.
shared/​yeast/​tests/​test.rs Simplify nested conditions using let chains.
shared/​yeast/​src/​visitor.rs Reorder imports.
shared/​yeast/​src/​query.rs Reorder imports.
shared/​yeast/​src/​lib.rs Reformat imports and short conditionals.
shared/​yeast/​src/​dump.rs Simplify nested conditions and reorder imports.
shared/​yeast/​src/​build.rs Simplify source-range handling using a let chain.
shared/​yeast/​Cargo.toml Upgrade to the inherited 2024 edition.
shared/​yeast-schema/​src/​schema.rs Reorder imports.
shared/​yeast-schema/​Cargo.toml Upgrade to the inherited 2024 edition.
shared/​yeast-macros/​src/​template_parse.rs Simplify punctuation validation using a let chain.
shared/​yeast-macros/​src/​rule_parse.rs Simplify rule-body validation using a let chain.
shared/​yeast-macros/​src/​lower.rs Reorder imports.
shared/​yeast-macros/​src/​ast.rs Reformat a test’s slice pattern.
shared/​yeast-macros/​Cargo.toml Upgrade to the inherited 2024 edition.
shared/​tree-sitter-extractor/​Cargo.toml Inherit the workspace edition.
shared/​extractor-common/​Cargo.toml Inherit the workspace edition.
rust/​extractor/​Cargo.toml Inherit the workspace edition.
rust/​autobuild/​Cargo.toml Inherit the workspace edition.
rust/​ast-generator/​Cargo.toml Inherit the workspace edition.
ruby/​extractor/​Cargo.toml Inherit the workspace edition.
ql/​extractor/​Cargo.toml Upgrade to the inherited 2024 edition.
ql/​buramu/​tree-sitter-blame/​Cargo.toml Upgrade to the inherited 2024 edition.
ql/​buramu/​tree-sitter-blame/​bindings/​rust/​lib.rs Mark the foreign-function block unsafe.
ql/​buramu/​Cargo.toml Upgrade to the inherited 2024 edition.
python/​extractor/​yeast-python/​Cargo.toml Inherit the workspace edition.
misc/​bazel/​3rdparty/​rust_workspace_deps/​crates.bzl Align generated crate edition metadata with Cargo.
cpp/​extractor/​bmn/​Cargo.toml Inherit the workspace edition.
Cargo.toml Set the shared workspace edition to 2024.

Review effort: Balanced (adaptive)

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

C++ Python QL-for-QL Ruby Rust Pull requests that update Rust code Unified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants